I am working the exercises in this book and am having some trouble with sketch 6-08 having to do with Analog Outputs. No matter what number I type in the Serial Monitor 0-5 I get the same result displaying on my multi meter. The number I get is 2.15. If I type 3 it reads 2.15 and if I type 5 it reads 2.15. I have the multi meter set on the 20 mark in the V section of the meter just like in the picture on page 101 Figure 6-11. The ground lead (black cable) is connected to the wire from one of the GND pins and the red cable is connected to the wire from pin 3 on the Arduino. I am using the 1.0 version if the IDE.
Has anyone else been working from this book and had a similar problem?
All the other example I have tried out have worked as expected.
I have a wire plugged into pin3 and another wire plugged into a ground pin. The red wire from the meter is connected to the pin 3 wire and the black wire from the meter is connected to the ground wire. When I upload the code to the Arduino and open the Serial Monitor and type a number from 1 to 5 and hit enter the readout on the meter says 2.15 and some times 2.16. According to the book If I type 3 and hit enter the read out on the meter should be 3 volts. I think if I were type 5 the meter should display 5 volts. The dial on the multi meter is set at V 20.
I'm having the exact same problem, the meter is wired up and set correctly. I tried different pwm pins and the same thing happened, then I checked the serial monitor to see the value of volts and what happened was that it would display the right value eg. 255 when 5 is pressed but then a new value,-1938 gets printed immediately no matter what I type -1938 comes afterwards immediately. I'm stumped and can't think of any way to fix this...