Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void setup()
- {
- Serial.begin(9600);
- pinMode(LED_BUILTIN, OUTPUT);
- }
- void loop()
- {
- unsigned char ch = 0; //Variable for storing Incoming_value
- if(Serial.available())
- {
- ch = Serial.read(); //Read the incoming data and store it into variable Incoming_value
- if (ch == '1')
- digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
- else
- digitalWrite(LED_BUILTIN, LOW); // turn the LED on (HIGH is the voltage level)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement