Lesson goal: Make an electronic etch-a-sketch

Previous: Linearly scale a potentiometer | Home | Next: Read a digital input

In a previous lesson, you learned how to read (and scale) a voltage, from a potentiometer. In this lesson we'll read and scale two potentiometers to make an electronic etch-a-sketch.

Now you try. Scale the voltages from each potentiometer so you can draw in the entire plot area! Then draw something cool!

Type your code here:


See your results here:

Wire up this circuit, using two potentiometers. Run the above code, and turn the potentiometers along their full range of motion. You should be able to "draw" with the potentiometers in a small square near the center of the screen.

Reformulate the x = v1 and y = v2 lines to scale v1 and v2 to fill the whole screen. For each, use a linear expression of the form $y=mx+b$, or y=m*v1+b and y=m*v2+b.

Instead of plotting points, you can also try plotting small circles via circle(x,y,2). Dismiss.

Show a friend, family member, or teacher what you've done!

Here is a share link to your code:

Does your code work? Want to run it on your iPhone?

Here's your code:

  1. Use [Control]-[C] (Windows) or [⌘]-[C] (MacOS) to copy your code.

  2. Paste it using [Control]-[V] (Windows) or [⌘]-[V] (MacOS) into this page

  3. Then click the "Use on iPhone" button that you'll see.