Getting Started with Arduino

@monumentalfolly I happen to be working on a program that will do just that. The goal is to output all 49 notes of the keyboard to the oscillator on pin 9. I’m not quite there yet, but it does make noise, lol.

int speakerPin = 9;

int Notes[] = {15,19,25,28,32,38,39,44,51,53,59,62,
69,70,75,78,84,87,93,96,101,103,109,112,
117,121,126,128,134,137,143,145,150,156,158,165,
171,177,179,184,188,190,195,202,204,210,214,217,
221};

char* CharNotes[] = {“C1”,“CS1”,“D1”,“DS1”,“E1”,“F1”,“FS1”,“G1”,“GS1”,“A1”,“AS1”,“B1”,
“C2”,“CS2”,“D2”,“DS2”,“E2”,“F2”,“FS2”,“G2”,“GS2”,“A2”,“AS2”,“B2”,
“C3”,“CS3”,“D3”,“DS3”,“E3”,“F3”,“FS3”,“G3”,“GS3”,“A3”,“AS3”,“B3”,
“C4”,“CS4”,“D4”,“DS4”,“E4”,“F4”,“FS4”,“G4”,“GS4”,“A4”,“AS4”,“B4”,
“C5”};

void setup ()
{
Serial.begin(9600);
// pinMode (buttonPin, INPUT);
pinMode (speakerPin, OUTPUT);
}

void loop ()
{ for (int n = 0; n<=48; n++)
{analogWrite(speakerPin, Notes[n]);
delay(500);
analogWrite(speakerPin, 0);
delay(250);
}

};

Thanks.

I tried it and I got an error. Doesn’t

int buttonPin

need to be defined?

I added

int buttonPin = 1;

(I don’t have the button bit, but I do have the keyboard bit which I think would serve the same purpose?)

Adding that, and the code verifies, and works.

And actually, the keyboard bit doesn’t really do anything. I.e., with or without it at A1, the sequence of notes starts.

@monumentalfolly I Deleted the button part. It will play notes automatically over and over again.

@monumentalfolly I corrected the array in this code; the array shown now plays 3 times more notes than it did last week. I hope you are having fun experimenting with the Arduino. :smile:

Hi all,
do you have a procedure for W8 setup, I have some difficulties to connectect the COM port under arduino, the port is not recognize.
thanks

Hey @Supa,

Are you connecting the power module to the Arduino module while connecting to the computer? Also, what type of operating system are you using? I’m wondering if you have a port blocked. I could give you instructions to reset the module if you are still having difficulties.

@MR_STEAM
Yes I have the power module plugged in the arguing while connecting to the computer. What is supprising for me by the way, as the USB can power the system like for the arduino UNO R3.
The port is detected ths first time and after a run he became unsuable.
I am running under windows 8 and not an expert of it.

@Supa, yes this is definitely possible! You would have to solder a couple of pads together to accomplish this. Did you read that on another post? Also, try resetting your Arduino with the following steps:

If this doesn’t work, try resetting the Arduino with these steps:

  1. Short the pins in the attached picture (i.e. directly connect them to each other with short strip of wire or a staple): The pins you need to short are a2 and d10. Place a small wire in those two pin holes and hold them tightly while continuing through the reset process.
  2. Connect the USB to the Arduino and turn the power on to the Arduino.
  3. Press ‘upload’ in the Arduino IDE with a code that is known to not cause issues.
  4. When the status bar changes from “compiling sketch” to “uploading…” remove whatever you are using to short the two pins.
  5. Your sketch should now successfully upload.

Let us know if this helps

Hi,
Thanks for the tip in order to reset the arduino. I was aware of the procedure.
For the power, I do not feel comfortable to make some solder on it. I am going to test the USB power bit solution.
Denis

Have you attempted to connect the Arduino on another computer?

Yes and it works. Thanks

My IDE does not have the Leonardo board option, I’m using a Linux Ubuntu. I’m not sure what I should do about it! Please help! It says I need 140 characters to post this so, just ignore this bit! hfjfsjvfenjdbfkndfbnkgfdknfbkngbdndbfkndgbkjfgdkmdnighddjnhdnkjkkk

A3, A4, and A5? Is that right? Mine shows A2, A3, and A4. I actually need an A5 for the I2c protocol. Is there an A5 pin?

@manny_alvear Yes, mine also shows a2, a3 and a4; I mistyped above. Regarding I2c, you need to solder a couple wires to the two solder pads just below d0, labeled d2 and d3. Here is a discussion thread on this topic with pictures: Where is I2C Clock (Analog 5)

Where is the “attached picture” to show were to connect the wire to reset?

you need to change the board to the correct model as explained at the top of the page. Its Arduino Leonardo.

I just did a class that teaches the foundations of this, using the Threshold bit http://littlebits.cc/tips-tricks/tips-tricks-threshold and the Latch bit http://littlebits.cc/tips-tricks/fridays-tips-tricks-latch. I have always been a little fuzzy on the concept until I dug around and learned how to use those two bits.

1 Like

Hi there,

I have bought a arduino little bits recently. I have followed the step by step instruction to connect my arduino to my mac. However, it didn’t work. The connection between the mac and the arduino was broken after i have plugged in the cable for a while. Any help please??

How are you powering the Arduino? With the battery or mains adapter? You will need the mains adapter as the Arduino needs a lot of power.