0

How Can I read a serial print
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

How Can I read a serial print

by Ganderra on Tue Dec 18, 2018 4:30 am

I want the code to read the serial number that it receives eg if the number given = 1 do that
I couldnt find the right documentation for this using Arduino Uno
Basic Code I am running
Code: Select all | TOGGLE FULL SIZE
void setup() {
  Serial.begin(9600);
}

void loop() {
  Serial.println(digitalRead(4));
  delay(100);
}


So if input from line sensor = 1 I want the buzzer to sound and a red LED to happen
but if input to = 0 I want the LED to go green
Note I will not be using a RGB LED instead I will use two seprate LEDs

Thanks in Advance!

Ganderra
 
Posts: 7
Joined: Thu Aug 09, 2018 12:55 am

Please be positive and constructive with your questions and comments.