옵션 |
|
int led = 13;void setup() {pinMode(led, OUTPUT);}void loop() {digitalWrite(led, HIGH);delay(1000); // wait for a seconddigitalWrite(led, LOW);delay(1000); // wait for a second} |
#define RED 7 #define YELLOW 6 #define GREEN 5
void setup() { pinMode(RED, OUTPUT); pinMode(YELLOW, OUTPUT); pinMode(GREEN, OUTPUT); }
void loop() { digitalWrite(RED, HIGH); digitalWrite(YELLOW, HIGH); digitalWrite(GREEN, HIGH); delay(500); digitalWrite(RED, LOW); digitalWrite(YELLOW, LOW); digitalWrite(GREEN, LOW); delay(500); } |