Playing with analog meters update: video with some code

After getting the analog meter up and running last time I took the standard Arduino “Fade” example and modified it to make sense with a meter instead of an LED.

I modified the “fade” sketch with more variables (for easy alteration) and playing around with quite a few settings. I added variables for the initial needle position on the gauge, how far to swing the needle and how fast to swing the needle. I also added some minor logic to derive maximum/minimum swing values for ease of alteration.

I found that swinging the needle about 10 points (out of 255) to either side of the initial value (so a “sweep” of 20, or just under 10% the total available distance) at a speed of 15 gave a pretty good “jitter” effect:

[youtube]vJsEQNY7l1o[/youtube]

The code I made is below if anyone is vaguely interested or would like to laugh at my programming skills.

[codebox 1]