Advertisement
RuiViana

MD_Var

Jan 19th, 2018
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. int var_1 = 0;
  2. int var_2 = 0;
  3. int var_3 = 0;
  4. int var_4 = 0;
  5. int var_5 = 0;
  6. //--------------------------------
  7. void setup()
  8. {
  9.   Serial.begin(9600);
  10. }
  11. //--------------------------------
  12. void loop()
  13. {
  14.   for (int i = 1; i < 6 ; i++)
  15.   {
  16.     switch (i)
  17.     {
  18.       case 1:
  19.         var_1 = i;
  20.         break;
  21.       case 2:
  22.         var_2 = i;
  23.         break;
  24.       case 3:
  25.         var_3 = i;
  26.         break;
  27.       case 4:
  28.         var_4 = i;
  29.         break;
  30.       case 5:
  31.         var_5 = i;
  32.         break;
  33.     }
  34.   }
  35.   Serial.println(var_1);
  36.   Serial.println(var_2);
  37.   Serial.println(var_3);
  38.   Serial.println(var_4);
  39.   Serial.println(var_5);
  40.   Serial.println();
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement