void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
DDRA=0xFF;//ประกาศให้เป็น output ที่porta
}
void loop() {
// put your main code here, to run repeatedly:
int c;//กำหนดให้ตัวแปร c=0
for(c=0;c<8;++c){
PORTA=~(0x01<<c);//เป็นการเลื่อนbitไปทางซ้ายมือไปจํานวน c bit
delay(250);
PORTA=0xFF;//ทำให้ไฟทุกดวงดับ
delay(350);
}
}