Advertisement
Guest User

Untitled

a guest
Nov 10th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <LiquidCrystal.h>
  2.  
  3. LiquidCrystal lcd(13,12,11,10,9,8);
  4. const int reset=6;
  5. const int countup=7;
  6. int count=0;
  7.  
  8. void setup() {
  9.     lcd.begin(16,2);
  10.     pinMode(countup, INPUT);
  11.     pinMode(reset, INPUT);
  12. }
  13.  
  14. void loop() {
  15.     if (digitalRead (countup) == HIGH) {
  16.         count++;
  17.     }
  18.  
  19.     if (digitalRead (reset) == HIGH){
  20.         count = 0;
  21.     }
  22.    
  23.     lcd.clear;
  24.     lcd.setCursor(0,0);
  25.     lcd.print(count++);
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement