Lissajous Curve

by tonygo2 in Circuits > Microcontrollers

667 Views, 2 Favorites, 0 Comments

Lissajous Curve

Lissajous-1.jpg

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

Lissajous Curve

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

DSCN4623.JPG

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.

DSCN4628.JPG

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

Downloads