Skip to content

Instantly share code, notes, and snippets.

@artob
Created February 20, 2020 13:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save artob/c27dc4387292b9e63fd5a2999afa89aa to your computer and use it in GitHub Desktop.
Save artob/c27dc4387292b9e63fd5a2999afa89aa to your computer and use it in GitHub Desktop.
#include <cstdio> // for printf()
#include <unistd.h> // for sleep()
int number = 0;
void setNumber() {
printf("%d\n", number);
}
void loop() {
setNumber();
sleep(1);
number = (number + 1) % 10;
};
int main(void) {
while (1) {
loop();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment