O'Reilly logo

Raspberry Pi For Dummies by Mike Cook, Sean McManus

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Making a Pot-a-Sketch

You are now well on your way to exploring what the Raspberry Ripple board can do for you. Next up you can make “pot-a-sketch,” or a pot box drawing tool. This is simply four potentiometers in a box. Figure 17-12 shows the schematic and Figure 17-13 shows a photograph of the finished product. I used a small plastic box and push-on knobs with red, green, blue, and yellow push-on tops. For this program, you have one pot for the X movement and one for the Y movement, with the other two defining the color in terms of hue and saturation. The Delete key or spacebar is used to wipe the screen clean. Figure 17-14 shows a screen dump of it in action. Fire up the program pot-a-sketch.py and twiddle the knobs to make your drawing. Again, the code to drive this is on the website. (See this book’s Introduction for more on how to access the website.)

9781118554234-fg1712.eps

Figure 17-12: The schematic of the pot box.

9781118554234-fg1713.tif

Figure 17-13: The pot box wired to the Raspberry Ripple.

9781118554234-fg1714.tif

Figure 17-14: A scribble produced by Pot-a-Sketch.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required