Advertisement
DrAungWinHtut

multiplyTable.ino

Aug 20th, 2022
1,472
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int led_red_pin = 13;
  2. int led_orange_pin = 12;
  3. int led_green_pin = 11;
  4.  
  5. void setup()
  6. {
  7.   pinMode(led_red_pin, OUTPUT);
  8.   pinMode(led_orange_pin, OUTPUT);
  9.   pinMode(led_green_pin, OUTPUT);
  10.   Serial.begin(9600);
  11.  
  12.  
  13.   for(int k=1;k<17;k++)
  14.   {
  15.     Serial.print(" Multiply table for ");
  16.     Serial.println(k);
  17.     Serial.println("========================");
  18.     for(int i = 1;i<13;i++)
  19.     {
  20.         Serial.print(k);
  21.         Serial.print(" * ");
  22.         Serial.print(i);
  23.         Serial.print(" = ");
  24.         Serial.println(funMultiply(k,i));
  25.     }
  26.     Serial.println();
  27.   }
  28.  
  29.  
  30.  
  31.  
  32.  
  33. }
  34.  
  35. void loop()
  36. {
  37.  //function call, invoke
  38.  
  39. }
  40.  
  41. void funLedBlink(int led_pin,int time)
  42. {
  43.   digitalWrite(led_pin, HIGH);
  44.   delay(time);
  45.   digitalWrite(led_pin, LOW);
  46.   delay(time);
  47. }
  48.  
  49. int funMultiply(int a, int b)
  50. {  
  51.   int m = a * b;  
  52.   return m;
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement