Skip to content

Instantly share code, notes, and snippets.

@InputBlackBoxOutput
Created October 27, 2020 15:10
Show Gist options
  • Save InputBlackBoxOutput/61d4782674674ac92575a96dfbb6e4e4 to your computer and use it in GitHub Desktop.
Save InputBlackBoxOutput/61d4782674674ac92575a96dfbb6e4e4 to your computer and use it in GitHub Desktop.
// 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