标签:inpu lan name read color modules ram 输出 write
咱使用 GPIO0
https://nodemcu.readthedocs.io/en/master/modules/gpio/#gpioread
GPIO设置为输出的状态下读取引脚状态
gpio.mode(3, gpio.OUTPUT) gpio.write(3, gpio.HIGH) if gpio.read(3) == 1 then print("GPIO0 is HIGH") end
可以检测继电器输出的状态,自行扩展!
GPIO设置为输入的状态下.检测GPIO状态
gpio.mode(3, gpio.INPUT,gpio.PULLUP) if gpio.read(3) == 1 then print("GPIO0 INPUT is HIGH") end
提示:
ESP8266 LUA脚本语言开发: 外设篇-GPIO输入检测
标签:inpu lan name read color modules ram 输出 write
原文地址:https://www.cnblogs.com/yangfengwu/p/12037992.html