I built the circuit for the Controller.pde. I am getting the reading for the accelerometer OK but for the button I am not getting any change in the reading. It just stays at 0. I tried the button circuit on a sketch that worked for me before and it show the change. Any ideas? Thanks Jim D
Did you type in the code or did you download it from the book’s web site?
What version of the Arduino IDE do you use?
It’d be helpful, if you could post a photo of your current circuit.
I downloaded it from the books web site. I am using the 23 release. I also tried the 1.0 release. I will try to get a picture posted
It should work on Arduino 23 and on Arduino 1.0, so I guess there’s something wrong with your wiring. A picture would be really helpful.
I have a picture on the Arduion Yahoo group in a folder called Jim D. Do you have access ti the group. Jim
Could you send me a link, please?
Here is the link to the Yahoo Arduino Group were the picture is http://groups.yahoo.com/group/arduinohome/photos/album/85788622/pic/list
As far as I can see, there is nothing wrong with the wiring, but it looks a bit complicated. Did you try to build it exactly as it is shown in Figure 6.4?
At least I am wondering why you’re using both the 3.3V and the 5V power supply pins?
I was using the 5 volt as a test running it to button. I did not make any difference. I am getting voltage right to digital 7 on the Auduino.
I just got to this chapter. Here’s what I think is going on: Bounce sends one “1” when the switch is pressed and one “0” when it is released.
The loop is so fast, you are never going to see this. I did two things to test this.
First, put a delay(100) in the loop. Now you can see the “1”. Second, the if … else in loop prints out a “0” by default. Change it to an “x” in the else part of the loop. Now you will see a bunch of “x” characters with an occasional “1” or “0”.
The changes should be removed for use with the game.