Introduction: Lissajous Curve

About: Retired teacher of computing - started 1967 with FORTRAN IV. I now play with development boards such as Raspberry Pi, Pico, Arduino, micro:bit and Adafruit CircuitPython boards like the Insybitsy M4 and Circui…

This Instructable illustrates the production of Lissajous Curves on a small 320x240 pixel display using MicroPython and the Pimoroni Pico Graphics system of producing graphics.

Supplies

Raspberry Pi Pico microcontroller - I used a Pico Lipo

Pimoroni Pico Display 2 - 320x240 pixel display

Thonny Editor - free download

USB cable

Step 1: The Video

Have a look at the video. The first half requires no user input and shows different numbers of nodes on the x and y axis. The second half is more dynamic and demonstrates what happens to the curves as you change the number of nodes by pressing the buttons and the phase shifts.

x and y are defined by a pair of equations:

  • sin(nt + a), cos(kt + b) or
  • sin(nt + a), sin(kt + b) or
  • cos(nt + a), cos(kt + b) or
  • x = cos(nθ), sin(k&theta)

You can see how they work by looking at the code and the video.

I hope you enjoyed it. Comments and discussion welcome.

Step 2: Potentiometer Control

The buttons only allow you to control two variables, n and m. I decided to switch control to 3 10 K Ohm potentiometers so that we could control the phase shift as well as the number of nodes in the x and y directions. The new layout is shown in the picture.

Step 3:

The new version can still show the moving curves automatically but also allows the user better control of the phase shifting.