Go Down

Topic: Project 07 Keyboard Instrument (Read 62140 times) previous topic - next topic


Just started doing this and had the same problem.
Then after looking here realised in the book the 2 lines

int buttons[6];
int buttons[0] 0 = 2;

don't have line numbers at the start

Then the following line is:

1 int notes[] = {262,294,330,349};

I guess those first 2 lines aren't in the program, you're right though confusing, although i guess they are there for a reason of tutorial but as of yet i don't understand what it is trying to teach.


I had all these same problems. I tried everything that everyone suggested. The solution for me was adjusting the keyVal ranges...

if (keyVal >= 1011 && keyVal <=1023) {
    tone(8, notes[0]);
  } else if (keyVal >= 990 && keyVal <= 1010) {
    tone(8, notes[1]);
  } else if (keyVal >= 400 && keyVal <= 515) {
    tone(8, notes[2]);
  } else if (keyVal >= 5 && keyVal <= 10) {
    tone(8, notes[3]);
  } else {


I had the same problem. Circuitry was fine, but it turned out I had the wrong resistor. Triple-check your colors!

Go Up