File size: 469 Bytes
bfa05c8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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);
}
}