|
|
试着写了一段代码:- #include <Process.h>
- int startPin = 7;
- int stopPin = 6;
- String strstart = "echo -n 'start' | socat - udp-connect:192.168.0.25:60002";
- String strstop = "echo -n 'stop' | socat - udp-connect:192.168.0.25:60002";
- void setup() {
- pinMode(startPin, INPUT);
- pinMode(stopPin, INPUT);
- Bridge.begin();
- // Serial.begin(9600);
- }
- void loop() {
- Process p;
- digitalWrite(startPin,HIGH);
- digitalWrite(stopPin,LOW);
- p.runShellCommand(strstart);
- delay(3000);
- digitalWrite(startPin,HIGH);
- digitalWrite(stopPin,LOW);
- p.runShellCommand(strstart);
- delay(3000);
- }
复制代码 然后把wifi关了,断电重启,刚开始可以控制继电器,能ping通,但1-2分钟后继电器停止工作,ping也ping不同.... |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|