daily pastebin goal
60%
SHARE
TWEET

numbercounterinput

a guest Apr 16th, 2018 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void setup() {
  2.   // put your setup code here, to run once:
  3.   Serial.begin(9600);
  4.  
  5. }
  6.  
  7. void loop() {
  8.   // put your main code here, to run repeatedly:
  9.   if(Serial.available()>0)
  10.   {
  11.     int a = Serial.parseInt();
  12.     int b = Serial.parseInt();
  13.     if(Serial.read() == '\n')
  14.     {
  15.       int c = a + b;
  16.       Serial.println(c);
  17.     }
  18.   }
  19. }
RAW Paste Data
Top