Skip to content

Instantly share code, notes, and snippets.

@doleron
Last active May 5, 2019 13:02
Show Gist options
  • Save doleron/2b4773365d84991d718022226494381d to your computer and use it in GitHub Desktop.
Save doleron/2b4773365d84991d718022226494381d to your computer and use it in GitHub Desktop.
Esp8266 01 cheap WIFI Relay Module from Shenzhen LC Technology Co or just lctech-inc.com. Just a example how to control the relay by sending serial hex codes
void setup() {
Serial.begin(9600);
}
void loop() {
byte close[] = {0xA0, 0x01, 0x01, 0xA2};
Serial.write(close, sizeof(close));
delay(2000);
byte open[] = {0xA0, 0x01, 0x00, 0xA1};
Serial.write(open, sizeof(open));
delay(2000);
}
@robpto
Copy link

robpto commented May 4, 2019

Thanks ! This helped me a lot !

@doleron
Copy link
Author

doleron commented May 5, 2019

Good to know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment