| int myNum; | |
| int br=9600; | |
| int rem; | |
| String myColor; | |
| String myPrompt="Please Enter Your Color: "; | |
| void setup() { | |
| // put your setup code here, to run once: | |
| Serial.begin(br); | |
| } | |
| void loop() { | |
| Serial.println(myPrompt); | |
| while (Serial.available()==0){ | |
| } | |
| myColor=Serial.readString(); | |
| myColor.toLowerCase(); | |
| if (myColor=="red"){ | |
| Serial.println("My Color!"); | |
| } | |
| if (myColor!="red"){ | |
| Serial.print("Your Color is "); | |
| Serial.print(myColor); | |
| } | |
| } | |