Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <LiquidCrystal.h>
- LiquidCrystal lcd (2,3,4,5,6,7);
- int ir = A0;
- void setup() {
- lcd.begin (16,2);
- Serial.begin(9600);
- pinMode(A0,INPUT);
- lcd.begin(16,2); // BEGINNING THE LCD
- lcd.clear();
- lcd.setCursor(3,0);
- lcd.print("TEKNOLOGI");
- lcd.setCursor(2,1);
- lcd.print("ELEKTROMEDIK");
- delay(2000);
- lcd.clear();
- lcd.setCursor(2,0);
- lcd.print("MINAL AIZIN");
- lcd.setCursor(2,1);
- lcd.print("T201601010");// SUBSCRIBE THE CHANNEL
- delay(2000);
- }
- int count = 0;
- void loop() {
- if(digitalRead(ir)==0)// CHECKING INPUT
- {
- while(digitalRead(ir)==0)// WAITING FOR INPUT TO END
- {};
- count= count+1; // INCREMENT VISIT COUNT BY 1
- lcd.clear();
- lcd.print("JUMLAH TETESAN =");
- lcd.setCursor(0,2);
- lcd.print(count);// DISPLAYING THE NUMBER OF VISITS.
- delay(40);
- }
- else
- {
- lcd.clear();// CASE WHEN NO INPUT IS RECEIVED.
- lcd.print("JUMLAH TETESAN = ");
- lcd.setCursor(0,2);
- lcd.print(count);
- delay(40);
- }
- }
Add Comment
Please, Sign In to add comment