Advertisement
Khadija_Assem

Untitled

Dec 13th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. String a,b;
  2. int ans;
  3. void setup() {
  4. // put your setup code here, to run once:
  5. Serial.begin(9600);
  6. }
  7.  
  8. void loop() {
  9. // put your main code here, to run repeatedly:
  10. while(!(Serial.available()>0));
  11.  
  12. while(Serial.available()>0)
  13. a = Serial.readStringUntil('\n');
  14.  
  15. Serial.println("The Value Of A " + a);
  16.  
  17. while(!(Serial.available()>0));
  18.  
  19. while(Serial.available())
  20. b = Serial.readStringUntil('\n');
  21.  
  22. Serial.println("The Value Of B " + b);
  23.  
  24. ans = a.toInt()+b.toInt();
  25.  
  26. Serial.println("The Value Of A + B " + String(ans));
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement