Friends:
In an if statement, if I want to indicate that any one of several inputs to the serial port should cause an event to occur, how is it coded? For instance, if I want a pin set high, or to serialPrint something if the serial port receives the character "a", the code might read as follows:
if (Serial.available() > 0);
{
char letter = Serial.read();
if (letter == 'a')
{
Serial.println (F("ON"));
However, what if I want the same thing done-- i.e., Serial.println (F("ON"))-- if the port receives an "a", or "b", or "c"?
I cannot seem to find an informative answer or tutorial.
Thank you in advance.
if statement with multiple conditions
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- Franklin97355
- Posts: 23940
- Joined: Mon Apr 21, 2008 2:33 pm
- fprete
- Posts: 110
- Joined: Mon Feb 09, 2015 3:06 pm
Re: if statement with multiple conditions
Thank you very much.
Please be positive and constructive with your questions and comments.