Friday, January 14, 2011

Chapter 5 - Experiment 35 Completed


Exercise 35 is pretty straightforward... you can see in the photo that I've added in the trimmer potentiometer to the circuit, making certain the center terminal connects to pin 5 on the PICAXE (logic pin 2).

I ran through a few tests, taking a reading with my multimeter at various settings... the debug window screenshot I'm including here shows the potentiometer maxed out at resistance - that's what the 255 for b0 is referencing.

I took about four different readings and compared the resistance readings on the multimeter to the chart on page 307... pretty close and the deviations are certainly due to the fact that this is an analog device and I'm turning a slot screw to increase or decrease the resistance... but I totally understand why the values you'd obtain with any trimmer would be linear in nature.

The final step was to update the code to allow the LED to flash faster or slower based on the trimmer... I'm including a video here that shows those results. Pretty cool stuff. Make certain you understand that paragraph on page 309 that talks about how you can use this information to control things with major changes being done in the code versus in the circuit.

Don't forget to read over the extras on page 310 that tell you about the different features that the PICAXE chips come with... I find it interesting that this little 08M chip has the ability to generate pseudorandom numbers and tones!

1 comment: