// LCD1602 to Arduino Uno connection example
#include <LiquidCrystal.h>
int button1 = 6;
int button2 = 5;
int button3 = 4;
int m = false;
int x;
void setup() {
/* funkcija sprintf ne pozna realnih števil. Realna števila moramo pretvoriti v string.
// To naredimo s funkcijo dtostrf
*/
pinMode(button1, INPUT_PULLUP);
pinMode(button2, INPUT_PULLUP);
pinMode(button3, INPUT_PULLUP);
}
void loop() {
int buttonState1 = digitalRead(button1);
if(buttonState1 == LOW & m1 == false){
lcd.setCursor(0,6);
m = !m;
x++
delay(1);
}
buttonState = digitalRead(button);
if(buttonState == HIGH & m1 == true){
m = !m;
lcd.clear();
delay(1);
}
lcd.setCursor(7,0);
lcd.print(x);
}