#include <LiquidCrystal.h>
const int rs = 12, en = 11, d4 = 4, d5 = 3, d6 = 2, d7 = 1;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
int led1 = 9;
int led2 = 8;
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("PIN YUTTASIN!");
pinMode(led1,OUTPUT);
pinMode(led2,OUTPUT);
}
void loop() {
lcd.setCursor(0, 1);
lcd.print(millis() / 1000);
digitalWrite(led1,HIGH);
digitalWrite(led2,LOW);
delay(2000);
digitalWrite(led1,LOW);
digitalWrite(led2,LOW);
delay(2000);
digitalWrite(led1,LOW);
digitalWrite(led2,HIGH);
delay(2000);
digitalWrite(led1,LOW);
digitalWrite(led2,LOW);
delay(2000);
}
ไม่มีความคิดเห็น:
แสดงความคิดเห็น