thay doi realy status cho 201

This commit is contained in:
HaiMD 2020-04-23 10:08:17 +07:00
parent f7b675434d
commit c9a1252a0c
2 changed files with 7 additions and 7 deletions

BIN
GPIO/GPIO

Binary file not shown.

View File

@ -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)
} }