Feather M4 Express used as signal generator and colour source for demonstrating sensor plotter on CLUE.

A Feather M4 Express board was enlisted to aid the demonstration of the sensor plotter in the video on the previous page. It provided:

  • alternating red, green blue light from the onboard NeoPixel for the CLUE's APDS-9960 colour sensor;
  • two analogue signals from A0 and A1 which were connected to the #0 and #1 pads on the CLUE using some test hooks.

Its SAMD51 (M4) processor is useful here as it has 2 DACs.

The code running on the board was very short and simply typed in over the serial console on CircuitPython's REPL.

import audioio, audiocore, board, neopixel, time

dacpair = audioio.AudioOut(board.A0,
filename = "adafruit-spinning-logo-plot-2chan.wav"
wav_file = open(filename, "rb")
samples = audiocore.WaveFile(wav_file)
samples.sample_rate = 500, loop=True)
pixel = neopixel.NeoPixel(board.NEOPIXEL, 1)

# Loop forever showing r, g, b while the
# DACs continue to loop the samples from wav file
while True:
    pixel[0] = (255, 0, 0)  # red
    pixel[0] = (0, 255, 0)  # green
    pixel[0] = (0, 0, 255)  # blue

Wav files are typically used for audio but they can be used for any signal. In this case the adafruit-spinning-logo-plot-2chan.wav has two signals following the top and bottom outline of the Adafruit logo, spinning 1/5th of a revolution in total across five frames.

Angled shot of a Adafruit Feather M4 Express.
It's what you've been waiting for, the Feather M4 Express featuring ATSAMD51. This Feather is fast like a swift, smart like an owl, strong like a ox-bird (it's half ox,...
In Stock
Angled shot of Basic Multi-Color Micro SMT Test Hooks (6-pack)
Testing and debugging is a challenging step in board manufacturing. It can be super tricky on a fully populated PCB. So how can you test connections when you have an assortment of...
In Stock

This guide was first published on Apr 01, 2020. It was last updated on Apr 15, 2024.

This page (Signal/Colour Generator) was last updated on Mar 08, 2024.

Text editor powered by tinymce.