32 lines
571 B
C++
32 lines
571 B
C++
|
|
#include "pitches.h"
|
|
|
|
int melody[] = {
|
|
NOTE_G4, NOTE_C6};
|
|
|
|
|
|
void setup() {
|
|
// put your setup code here, to run once:
|
|
/*delay(1000);
|
|
tone(6, melody[0], 200);
|
|
delay(1000);
|
|
tone(6, melody[0], 200);
|
|
delay(1000);
|
|
tone(6, melody[1], 100);*/
|
|
pinMode(A0,OUTPUT);
|
|
pinMode(A1,OUTPUT);
|
|
pinMode(A2,OUTPUT);
|
|
pinMode(A3,OUTPUT);
|
|
Serial.begin(9600);
|
|
}
|
|
|
|
void loop() {
|
|
int pins[] = {A0, A1, A2, A3};
|
|
for(int i=0;i<4;i++){
|
|
Serial.println(i, pins[i]);
|
|
digitalWrite(pins[i], HIGH);
|
|
delay(500);
|
|
digitalWrite(pins[i], LOW);
|
|
delay(500);
|
|
}
|
|
}
|