#include <LiquidCrystal.h>
LiquidCrystal lcd(12,11,10,9,8,7);
int counter=0;
byte hertz[8]={
0b00000,
0b01010,
0b11111,
0b11111,
0b11111,
0b11110,
0b00100,
0b00000,
};
void setup() {
// put your setup code here, to run once:
lcd.begin(16,2);
lcd.createChar(1,hertz);
pinMode(1, INPUT_PULLUP);
pinMode(2, INPUT_PULLUP);
pinMode(3, INPUT_PULLUP);
pinMode(4, INPUT_PULLUP);
pinMode(5, INPUT_PULLUP);
randomSeed(analogRead(A0));
}
void loop() {
// put your main code here, to run repeatedly:
if(digitalRead(1)==LOW){
counter ++;
delay(100);
}
else if(digitalRead(2)==LOW){
counter--;
delay(100);
}
else if(digitalRead(3)==LOW){
counter=0;
}
else if(digitalRead(4)==LOW){
counter=random(1,10);
delay(100);
}
if(digitalRead(5)==LOW){
lcd.setCursor(0,0);
lcd.write(1);
delay(100);
}
lcd.clear();
lcd.setCursor(0,1);
lcd.print(counter);
delay(100);
}