Created
October 27, 2020 15:10
-
-
Save InputBlackBoxOutput/61d4782674674ac92575a96dfbb6e4e4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// FizzBuzz using Arduino | |
// Author: @InputBlackBoxOutput | |
// Written on 20 Oct 2020 | |
// No additional components & connections required. | |
// Just connect your Arduino to your PC | |
#define BAUDRATE 9600 | |
#define LOOP_DELAY 700 | |
void setup() { | |
Serial.begin(BAUDRATE); | |
delay(10); | |
} | |
void loop() { | |
for (int i=1; i<=100; i++) { | |
if(i%3 == 0 && i%5==0) | |
Serial.println("FizzBuzz"); | |
else if(i%5==0) | |
Serial.println("Buzz"); | |
else if(i%3 == 0) | |
Serial.println("Fizz"); | |
else | |
Serial.println(i); | |
delay(LOOP_DELAY); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment