Skip to content

Instantly share code, notes, and snippets.

@rafalw rafalw/flying_monkey.ino
Last active Nov 5, 2018

Embed
What would you like to do?
"Latająca małpa" w wersji Arduino + LCD 16*2
#include <LiquidCrystal.h>
#define CZAS 100
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
void show_monkey(byte x, byte y, int time_disp) {
lcd.setCursor(x, y);
lcd.print("@");
delay(time_disp);
lcd.setCursor(x, y);
lcd.print(" ");
}
void setup() {
lcd.begin(16, 2);
lcd.noCursor();
lcd.setCursor(0, 0);
}
void loop() {
for (int i = 0; i < 16; i++) {
show_monkey(i, 0, CZAS);
}
for (int i = 15; i >= 0; i--) {
show_monkey(i, 1, CZAS);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.