Advertisement
Khadija_Assem

Untitled

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