Advertisement
jmyean

Multiplying the Previous Outputs “While” Each Output is Less

Mar 21st, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.  * Jung Min Yean
  3.  * March 20, 2019
  4.  * Program to print a variable ten times
  5.  * Ver 1
  6.  */
  7.   // define constants and variables
  8. int x = 3;
  9.  
  10. void setup()
  11. {
  12.   // declare your input and output
  13.   Serial.begin(9600);
  14.    while(x < 2000)
  15.   {
  16.     Serial.println(x); // + is add; - is subtraction; * is multiplication; / is division
  17.     x = x * 2;
  18.   }
  19. }
  20. void loop()
  21. {
  22.   // put your main code here, to run repeatedly:
  23.    
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement