Recent Posts
printf("ho_tari\n");
02_LED_ON_OFF 본문
const int LED[8] = {2, 3, 4, 5, 6, 7, 8, 9};
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println(sizeof(LED));
Serial.println(sizeof(int));
for(int i = 0; i < (sizeof(LED)/sizeof(int)); i++)
{
pinMode(LED[i], OUTPUT);
}
}
void loop() {
// put your main code here, to run repeatedly:
for(int i = 0; i < (sizeof(LED)/sizeof(int)); i++)
{
for(int i = 0; i < (sizeof(LED)/sizeof(int)); i++)
{
digitalWrite(LED[i], LOW);
}
digitalWrite(LED[i], HIGH);
delay(100);
}
/*
for(int i = sizeof(LED); i > 0; i--)
{
for(int i = sizeof(LED); i > 0; i--)
{
digitalWrite(LED[i], LOW);
}
digitalWrite(LED[i], HIGH);
delay(100);
}
*/
}
'Arduino' 카테고리의 다른 글
06_Switch_Input_Interrupt (0) | 2023.09.02 |
---|---|
05_Switch_Input (0) | 2023.09.02 |
04_Serial_Read (0) | 2023.09.02 |
03_Analog_Write (0) | 2023.09.02 |
01_Serial_print (0) | 2023.09.02 |