IP不卡 发表于 2025-3-28 17:26:22

上升沿计数

var fmt = import("fmt")
a = GetDeviceData("8路继电器->register0")
b = GetDeviceData("test->test1")
c = GetDeviceData("test->test2")
if a ==1 {
                b =1
                SetDeviceData("test->test1",b)
}
if a == 0 &&b ==1{
                c =c++
                SetDeviceData("test->test2",c)
                b=0
                SetDeviceData("test->test1",b)
fmt.Println("按钮启动计数",c,"次")
}

页: [1]
查看完整版本: 上升沿计数