Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <LiquidCrystal.h> //Dołączenie bilbioteki
- LiquidCrystal lcd(2, 3, 4, 5, 6, 7); //Informacja o podłączeniu nowego wyświetlacza
- #define LED 8
- #define BUT2 10
- #define BUT 9
- int iglo = 0;
- int stal = 0;
- boolean prz=LOW;
- boolean prz2=LOW;
- void setup() {
- lcd.begin(16, 2); //Deklaracja typu
- lcd.setCursor(1, 0); //Ustawienie kursora
- lcd.print("IGLOOPOL:STAL"); //Wyświetlenie tekstu
- lcd.setCursor(6, 1); //Ustawienie kursora
- // lcd.print("0:0"); //Wyświetlenie tekstu
- // lcd.cursor(); //Włącznie kursora
- pinMode(BUT,INPUT_PULLUP);
- pinMode(BUT2,INPUT_PULLUP);
- }
- void loop()
- {
- if(digitalRead(BUT2)==LOW)
- {
- delay(500);
- iglo++;
- }
- if(digitalRead(BUT)==LOW)
- {
- delay(500);
- stal++;
- }
- if(digitalRead(BUT)==LOW&&digitalRead(BUT2)==LOW)
- {
- iglo=0;
- stal=0;
- delay(1000);
- }
- lcd.setCursor(8,1);
- lcd.print(iglo);
- lcd.setCursor(7,1);
- lcd.print(":");
- lcd.setCursor(6,1);
- lcd.print(stal);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement