0% found this document useful (0 votes)
5 views

Data New

Uploaded by

yusufsatria2905
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Data New

Uploaded by

yusufsatria2905
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

#include <Wire.

h>

#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27, 16, 2);

Char LCD[40];

#define sensorIR A0

#define LED 12

#define BUTTON 11

#define BC digitalRead(BUTTON)==HIGH

Float sensorValue;

Int count = 0;

Void setup()

Lcd.begin();

Lcd.backlight();

pinMode(sensorIR,INPUT);

pinMode(BUTTON,INPUT);

pinMode(LED,OUTPUT);

lcd.setCursor(5,0);sprintf(LCD,”WELCOME”);lcd.print(LCD);

lcd.setCursor(1,1);sprintf(LCD,”DUNIA TIPU-TIPU”);lcd.print(LCD);

delay(2000);

lcd.clear();

Void loop()

{
Lcd.setCursor(0,0);sprintf(LCD,”CONVEYOR COUNTER”);lcd.print(LCD);

Lcd.setCursor(0,1);sprintf(LCD,”JUMLAH = %d”,count);lcd.print(LCD);

If(analogRead(sensorIR) >= 200)

While(analogRead(sensorIR) >= 200){};

Count+=1;

If (count >= 12)count=12;

Delay(500);

If (count == 12)

digitalWrite(LED,HIGH);

if(BC)

While(BC){};

Count=0;

Lcd.clear();

Else digitalWrite(LED,LOW);

You might also like