Lissajous Curve
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
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.
Downloads
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.
The new version can still show the moving curves automatically but also allows the user better control of the phase shifting.