2

I am working on a project for grade 10 computer science. I am supposed to make a piano that has 7 keys using a capacitive sensor, and the piano is supposed to teach you songs like Twinkle Twinkle Little Star by illuminating the LED corresponding with that key and then playing that tone on the speaker. There is also a "random scales" part where you are timed and have to press the keys as fast as you can as they light up. Unfortunately, I have come into a few problems.

  1. I ran out of outputs and have to use a shift register. I have no idea on how to control each of the outputs.
  2. When the game starts I want there to be 2 options a song and a random scales using randomSeed however I have NOT found a way for them to pick which option. I think I can do user input by typing or by them just pressing a key but I am not sure.
  3. I am pretty new on Arduino so anything helps.

Finally I am using the Arduino Uno and that is why I am short pins because I have 1 gnd 1 speaker and the rest key inputs.

apnorton
  • 493
  • 1
  • 5
  • 22
31089915
  • 21
  • 1
  • 1
    Are you sure you've run out of pins? Did you know you can use the analog pins as digital IO as well? – Peter Bloomfield Jan 09 '15 at 15:04
  • Thanks I didn't know about the analog, but there are only 6 analog pins and I need 7. Could I use one digital with 6 analog – 31089915 Jan 09 '15 at 15:16
  • Unfortunately you can't use digital pins as analog. If you need more analog inputs you'll probably need an external ADC (a shift register won't work for that). – Peter Bloomfield Jan 09 '15 at 15:20
  • I count 7 sense pins, 7 led pins, and one speaker pin. That is 15 digital pins. The uno has 18 pins available (don't use 0 and 1, as they are used for serial). Analog pins can be used as a regular digital pin. Your setup doesn't need the analogRead capability of the analog pins. – Gerben Jan 09 '15 at 19:20
  • 1
    Thanks I did end up using a shiftregister I had got theL LED's corresponding w/ the keys fo – 31089915 Jan 10 '15 at 16:59
  • 1
    Thanks I did end up using the shift register and the have the LED's corresponding w/ the keys to show the user where to press. I need to find a way to see if the participant actually pressed the right keys and to hopefully give them a score at the end. – 31089915 Jan 10 '15 at 17:02

0 Answers0