Created
July 14, 2015 16:09
-
-
Save ramithuh/bf45782246fa58ff490e to your computer and use it in GitHub Desktop.
Upload this sketch to your Intel Edison
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
int led=8; //int for led pin number | |
int c = -1; // int for income value | |
void setup() | |
{ | |
Serial.begin(115200); //set serial with baud rate | |
pinMode(led,OUTPUT); //set the pin as an output | |
} | |
void loop() | |
{ | |
if (Serial.available()>0){ //if we have incoming value | |
c =Serial.read()-48; //read the value minus 48 | |
// Serial.write(c); | |
if(c == 0) digitalWrite(led,LOW); //if 0 fingers turn off led | |
else if(c == 5) digitalWrite(led,HIGH); //if 5 fingers turn on led | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment