找回密码
 成为会员
搜索
热搜: 活动 交友 discuz
查看: 98|回复: 0

上升沿计数

[复制链接]

4

主题

1

回帖

66

积分

注册会员

积分
66
发表于 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,"次")
}

您需要登录后才可以回帖 登录 | 成为会员

本版积分规则

快速回复 返回顶部 返回列表