You'll notice that it is slightly different to the code you sent but when I tried that it fed back this error message:
avrdude: ser_open(): can't open device "/dev/tty.usbmodem411": No such file or directory
ioctl("TIOCMGET"): Inappropriate ioctl for device
Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.
The schematic you found is the correct one and I have followed it correctly.
When I depress the non-working key it prints 970 in the serial monitor but I'm afraid that I don't have the skills to interpret what that means!
Besides of that: Write down all the 4 values that each button is printing when pressed. I'm no mind reader and cannot guess which one is not working with your code.
Sorry, I will learn how to post code properly, I will fully read that post now. As I pointed out in my initial post in this feed I've been using Arduino for all of a few days.
I wasn't aware they were all relevant as tmd3 had only asked for the non-working one. Afraid I have no idea what any of the info being printed means or refers to though, I guess that the last number should be lower than the one above it, is that right?
ryanhughes:
... I'm afraid that I don't have the skills to interpret what that means!
That's great, because this is your chance to acquire those skills. If you're willing to put in the effort, I'm willing to help. If you want someone to figure it out for you, then somebody else will help you.
Here's your assignment:
Tell us where the value of variable keyVal comes from.
Go to the Reference page, here - Arduino - Home - and find the function that establishes that value, and read about it.
Take one of the values that you find on the serial monitor for a working button, and determine which of the tests in the sketch that it satisfies. What tone would you expect to hear when that key is depressed?
Take the non-working value, and determine which if the tests it satisfies. Tell us what you find, and what it means.
After that, we'll take a look at how those values are generated by the circuit.
Thanks so much for your responses both! I'm super busy this week but will get to my assignment ASAP, I'm looking forward to working through your suggestions and solving my keyboard issues.
Thanks for referring me to the reference page - I now have a much better understanding of analogRead and the values that it generates.
So when I make the change to the code which jurs suggested the key works and gives the value of 970 which falls between the 2 variables mentioned in that line of code!
Looking at how those values are generated by the circuit would be very useful for future reference.