First, we'll prep the Trellis M4 for running CircuitPython.

After assembling the case, plug your NeoTrellis into a computer (mac/PC/Linux) and look for a new flash drive in the operating system file explorer/finder program. It should be named CIRCUITPY. If you browse the files on this new drive, you'll see a file named boot_out.txt. If you see this, then you should be set. If not, go to troubleshooting below.

CircuitPython

The NeoTrellis M4 Express will be programmed using CircuitPython, the easy to use language on Adafruit's Express products. No coding is needed if you will just be copying the files in this guide.

If you'd like to know more about CircuitPython, there is a full getting started guide here.

To get the latest version of CircuitPython, please see the instructions in the NeoTrellis Guide.

The code is in text files so you can easily make changes with your favorite text editor. Adafruit suggests using the Mu editor to edit your code and have an interactive REPL in CircuitPython. You can learn about Mu and its installation in this tutorial.

This project requires CircuitPython version 4.0.0 alpha or later which does ship with NeoTrellis. Please do not use an earlier version of CircuitPython or libraries as they will not provide the functionality needed for this project.

Libraries

The code uses several libraries for helper code. Please go to the CircuitPython libraries releases page and download the zip file for CircuitPython 4.x to your computer hard drive. It will have a name similar to adafruit-circuitpython-bundle-4.x-mpy-20181211.zip but the date will most likely be different (as Adafruit adds more features),

Go into the library zip file and copy the following files to your NeoTrellis CIRCUITPY drive into a subdirectory named /lib:

  • Directory adafruit_bus_device
  • Directory adafruit_fancyled
  • adafruit_adxl34x.mpy
  • adafruit_matrixkeypad.mpy
  • adafruit_trellism4.mpy
  • neopixel.mpy

Troubleshooting

You can use the serial capability in Mu to connect to the NeoTrellis M4 to interact with the CircuitPython prompt. You can see error messages, restart the program, etc. 

Problem: I don't see the CIRCUITPY drive when I plug the NeoTrellis M4 into my computer or I see a drive named TRELM4BOOT instead.

Solution: Ensure CircuitPython is installed via this guide.

Problem: The code does not run.

Solution: Check the files on the CIRCUITPY drive.  /lib should have the latest CircuitPython 4.x libraries and you have placed code.py in the main (root) directory.

Problem: Not enough disk space for all the files.

Solution: If you have files from another NeoTrellis project, you may have to remove some or all of the other project-specific files to load files specific to this project.

If you use your own phrases, you cannot use long stereo clips or songs for each button, there is not enough flash disk space. You can reduce the number of files below 32. You can trim your clips to make them shorter. You should ensure all your clips are mono instead of stereo. 

Problem: My board isn't booting up!

Solution: Make sure your /lib folder is set up with the libraries in the 4.0 latest release.

Problem: I'm not hearing any sounds!

Solution: Ensure you have copied the sound files to the appropriate directories: /xmas holds 32 sound files. The files are in GitHub in a ZIP when you download the code.

Ensure you have headphones or powered speakers plugged into the sound output jack and that the volume is set appropriately. If you have put custom sounds on the NeoTrellis, check that all your files are formatted as Mono 16-bit, 22,050Hz, PCM. 

Next

Your Trellis M4 is now prepped to run CircuitPython code. Next, we'll add the sound and code files.

This guide was first published on Nov 26, 2018. It was last updated on Mar 17, 2024.

This page (Trellis M4 Setup) was last updated on Mar 08, 2024.

Text editor powered by tinymce.