Exercise 6.5: Building and Etch-A-Sketch


An Etch-A-Sketch is a classic toy wherein a child (or adult!) turns knobs to draw lines. To get an idea of how it works, check out this video.

Make an Etch-A-Sketch by using two potentiometers as the “knobs”. The voltages measured from analog inputs are then sent to Python and interpreted as positions in an x-y plane. You should have a Bokeh plot that gets updated as the knobs are turned.

You will need to add another potentiometer to the device you built for the lessons. You should connect it as the potentiometer you already have, but connect the middle lead of the potentiometer to pin A1 on the Arduino. You will then have to adjust the Arduino code to allow for another input and also to write a second voltage. To have the plot automatically update, you should read the auxiliary lesson on streaming data. Asynchronous computing is not necessary; you can ask for data on demand. Nonetheless, you should set up periodic callbacks for your Bokeh plot to update as data are acquired.