Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void setup()
- {
- Serial1.begin(9600);
- }
- void loop()
- {
- checkCondition();
- }
- void checkCondition()
- {
- String s1 = Serial1.readString();// s1 is String type variable.
- //display same received Data back in serial monitor.
- if(s1.indexOf("a")>=0)
- {
- Serial1.println("a");
- }
- if(s1.indexOf("b")>=0){
- Serial1.print("b");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement