Sample Arduino code of Internet connected LED
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//definitions for jumpwire.io | |
#define jumpwire_io_token "Set_your_token" | |
#define jumpwire_io_project "A" | |
#define your_WiFi_SSID "Set_your_ssid" | |
#define your_WiFi_password "Set_your_password" | |
#define your_ESP8266_baud_rate 115200 | |
//put your definitions here | |
//put your global variables here | |
void setup() { | |
jumpwireIoSetup(); //always put this code in setup() | |
//put your code here | |
pinMode(13, OUTPUT);// initialize digital pin 13. | |
} | |
void loop() { | |
jumpwireIoLoop(); //always put this code in loop() | |
//put your code here | |
} | |
void Catch(char key, float value) { | |
//this function is called when byte values on jumpwire.io server are changed | |
//put your code here | |
if (key == 'A') { | |
if(value == 0){ //if value of key A is 0 | |
digitalWrite(13, LOW); //turn OFF LED | |
} | |
else if(value == 1){ //if value of key A is 1 | |
digitalWrite(13, HIGH); //turn ON LED | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment