Feather Waveform Generator in CircuitPython

In this guide we’ll take a few simple parts, add some not quite as simple code, and build an adjustable waveform generator (aka frequency generator). Using a rotary encoder push-switch, we’ll select one of multiple waveforms, and using the rotation along with the three buttons on the OLED FeatherWing we’ll adjust the frequency. We have great guides on the Feather M0 Express and Feather M4 Express as well as the OLED Featherwing to get you up to speed on this hardware.

A small speaker is useful to listen to the signal as a functional test. There’s a nice one listed below but there are others; any 8 ohm speaker will work. The signal isn’t very strong, so stick with a small one. You can easily power this by the USB port, but a LiPo battery will let you use it on it’s own, untethered from a computer.

This project will work on either a Feather M0 Express or Feather M4 Express. Due to the additional performance and memory of the M4 board, capability of the code can be increased. This is pointed out in the code.”