Tick Tock Shield LED
อุปกรณ์ที่ใช้
1.Tick Tock Shield
2.Arduino Duemilanove
3.สายสำหรับโหลดข้อมูลลองบอร์ด Arduino
วิธีการทดลอง
1.นำบอร์ด Tick Tock Shield เสียบเข้ากับ
บอร์ด Arduino
2.เสียบสาย Load code ด้านล่างลง Arduino
Source code
void setup() {
pinMode(5, OUTPUT);
pinMode(4, OUTPUT);
pinMode(3, OUTPUT);
pinMode(2, OUTPUT);
}
void loop() {
digitalWrite(5, HIGH);
digitalWrite(4, LOW);
digitalWrite(3, LOW);
digitalWrite(2, LOW);
delay(100);
digitalWrite(5, LOW);
digitalWrite(4, HIGH);
digitalWrite(3, LOW);
digitalWrite(2, LOW);
delay(100);
digitalWrite(5, LOW);
digitalWrite(4, LOW);
digitalWrite(3, HIGH);
digitalWrite(2, LOW);
delay(100);
digitalWrite(5, LOW);
digitalWrite(4, LOW);
digitalWrite(3, LOW);
digitalWrite(2, HIGH);
delay(100);
digitalWrite(5, LOW);
digitalWrite(4, LOW);
digitalWrite(3, LOW);
digitalWrite(2, HIGH);
delay(100);
digitalWrite(5, LOW);
digitalWrite(4, LOW);
digitalWrite(3, HIGH);
digitalWrite(2, LOW);
delay(100);
digitalWrite(5, LOW);
digitalWrite(4, HIGH);
digitalWrite(3, LOW);
digitalWrite(2, LOW);
delay(100);
digitalWrite(5, HIGH);
digitalWrite(4, LOW);
digitalWrite(3, LOW);
digitalWrite(2, LOW);
delay(100);
}