Hi! This is my code:
#include "pitches.h"
int melody[]={
NOTE_C4,NOTE_G3,NOTE_G3,NOTE_A3,NOTE_G3,0,NOTE_B3,NOTE_C4};
int thisNote;
int noteDurations[]={
4,8,8,4,4,4,4,4};
int noteDuration;
void setup(){
for(thisNote=0;thisNote<8;thisNote++){
noteDuration=1000/noteDurations[thisNote];
tone(8,melody[thisNote],noteDuration);
int pauseBetweenNotes = noteDuration * 1.30;
delay (pauseBetweenNotes);
noTone(8); //stop note playing
}
}
void loop(){
}
I also have the pitches.h saved in a tab with the code that is given in the tutorial.
Here are my errors:
Arduino: nightly (Mac OS X), Board: "Arduino Uno"
Build options changed, rebuilding all
core.a(main.cpp.o): In function `main':
/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/avr/cores/arduino/main.cpp:40: undefined reference to `setup'
/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/avr/cores/arduino/main.cpp:43: undefined reference to `loop'
collect2: error: ld returned 1 exit status
What am I doing wrong?
Thank you for your help.