Arduino v220712
아기상어 + LED 깜빡이기 #define NOTE_C4 262 #define NOTE_D4 294 #define NOTE_E4 330 #define NOTE_F4 349 #define NOTE_G4 392 #define NOTE_A4 440 #define PIEZO_PIN 8 int ledArr[] = {9,6,5,3}; int ledSize = sizeof(ledArr)/sizeof(int); //notes in the melody: int melody[] = { NOTE_C4, NOTE_D4, NOTE_F4, NOTE_F4, NOTE_F4, NOTE_F4, NOTE_F4, NOTE_F4, NOTE_F4, NOTE_C4, NOTE_D4, NOTE_F4, NOTE_F4, NOTE_F4, NOTE_F4,..
Arduino v220704
void setup() { pinMode(8, OUTPUT); pinMode(9, OUTPUT); pinMode(10, OUTPUT); } void loop() { digitalWrite(8, LOW); digitalWrite(9, LOW); digitalWrite(10, LOW); delay(1000); // Wait for 1000 millisecond(s) digitalWrite(8, HIGH); delay(1000); // Wait for 1000 millisecond(s) digitalWrite(8, LOW); digitalWrite(9, HIGH); delay(1000); // Wait for 1000 millisecond(s) digitalWrite(9, LOW); digitalWrite(1..