thay doi realy status cho 201
This commit is contained in:
parent
f7b675434d
commit
c9a1252a0c
14
GPIO/GPIO.go
14
GPIO/GPIO.go
|
@ -68,7 +68,7 @@ var num_reconnect_pub = 0
|
||||||
var num_reconnect_sub = 0
|
var num_reconnect_sub = 0
|
||||||
var (
|
var (
|
||||||
// Use mcu pin 10, corresponds to physical pin 19 on the pi
|
// Use mcu pin 10, corresponds to physical pin 19 on the pi
|
||||||
relay = rpio.Pin(6) // 6- raspberry pi 1 / 9 - raspberry 3B+ PI3 :
|
relay = rpio.Pin(6) // (10.200)GPIO 6- raspberry pi 3 === GPIO 9 - raspberry 3B+ (10.201)
|
||||||
)
|
)
|
||||||
|
|
||||||
// {
|
// {
|
||||||
|
@ -195,8 +195,8 @@ func main() {
|
||||||
func Check_door() {
|
func Check_door() {
|
||||||
if door_state == true {
|
if door_state == true {
|
||||||
time.Sleep(time.Second * time_hold)
|
time.Sleep(time.Second * time_hold)
|
||||||
//relay.Low()
|
relay.Low() // 201
|
||||||
relay.High()
|
//relay.High()
|
||||||
if Debug == 1 {
|
if Debug == 1 {
|
||||||
fmt.Println("Close Door")
|
fmt.Println("Close Door")
|
||||||
fmt.Println("--------------------------------")
|
fmt.Println("--------------------------------")
|
||||||
|
@ -279,8 +279,8 @@ func mqtt_messageHandler(mqtt_bi mqtt.Client, message mqtt.Message) {
|
||||||
if door_state == true {
|
if door_state == true {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
//relay.High()
|
relay.High() // 201
|
||||||
relay.Low()
|
//relay.Low()
|
||||||
//Name = (list["name"]).(string)
|
//Name = (list["name"]).(string)
|
||||||
fmt.Println("Xin Chao Mung " + Name)
|
fmt.Println("Xin Chao Mung " + Name)
|
||||||
}
|
}
|
||||||
|
@ -317,8 +317,8 @@ func mqtt_messageHandler(mqtt_bi mqtt.Client, message mqtt.Message) {
|
||||||
if door_state == true {
|
if door_state == true {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
//relay.High()
|
relay.High() //201
|
||||||
relay.Low()
|
//relay.Low()
|
||||||
Name = (list["name"]).(string)
|
Name = (list["name"]).(string)
|
||||||
fmt.Println("Xin Chao Mung " + Name)
|
fmt.Println("Xin Chao Mung " + Name)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user