# NeoTrellis Light Painting

## Overview

https://youtu.be/42A9ugsNwcg

The NeoTrellis M4 is "some awesome hardware" as Charlotte the Spider would say. There are [some pretty great demos](https://learn.adafruit.com/search?q=NeoTrellis) on the Adafruit Learning System for using it.

All work and no play, well let's say the NeoTrellis isn't going to heavy lifting 24/7. Say you or your young one want a simple game in between gigs?&nbsp;

This tutorial turns your NeoTrellis into a simple paint program in seconds. Fun for young and old. You can change the keys to any of 12 colors (plus off/black).

## Parts
### Adafruit NeoTrellis M4 with Enclosure and Buttons Kit Pack

[Adafruit NeoTrellis M4 with Enclosure and Buttons Kit Pack](https://www.adafruit.com/product/4020)
So you've got a cool/witty name for your band, a Soundcloud account,&nbsp;[a 3D-printed Daft Punk helmet](https://learn.adafruit.com/3d-printed-daft-punk-helmet-with-bluetooth)...&nbsp;so what could be missing from your road to stardom? The **NeoTrellis M4 Kit...**

Out of Stock
[Buy Now](https://www.adafruit.com/product/4020)
[Related Guides to the Product](https://learn.adafruit.com/products/4020/guides)
![Demo Video of Hands pressing buttons on lit up NeoTrellis M4.](https://cdn-shop.adafruit.com/product-videos/640x480/4020-00.jpg)

### USB cable - USB A to Micro-B

[USB cable - USB A to Micro-B](https://www.adafruit.com/product/592)
This here is your standard A to micro-B USB cable, for USB 1.1 or 2.0. Perfect for connecting a PC to your Metro, Feather, Raspberry Pi or other dev-board or microcontroller

Approximately 3 feet / 1 meter long

In Stock
[Buy Now](https://www.adafruit.com/product/592)
[Related Guides to the Product](https://learn.adafruit.com/products/592/guides)
![USB cable - USB A to Micro-B - 3 foot long](https://cdn-shop.adafruit.com/640x480/592-01.jpg)

Optional portable power

# NeoTrellis Light Painting

## Code and Play

Plug your NeoTrellis into a USB port on your computer with a known good USB data+power cable. In your file explorer/finder, you should see a new flash drive named **CIRCUITPY** pop up.

If you see a new drive named **TRELM4BOOT** , you will need to load CircuitPython onto your NeoTrellis first. [See this page to do so](https://learn.adafruit.com/adafruit-neotrellis-m4/circuitpython). Your board should reboot when you put the code on the board and a **CIRCUITPY** drive should now be available.

## Code

Click the Download Project Bundle below to get a zip file with the **code.py** file and the library files needed.&nbsp;

Copy the files over to the **CIRCUITPY** drive, the **code.py** into the main directory, the .mpy file into the **/lib** subdirectory.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/NeoTrellis/NeoTrellis_Paint/code.py

![](https://cdn-learn.adafruit.com/assets/assets/000/126/254/medium800/gaming_one_one.png?1701183275)

## Play!

Press the buttons to get colors. Use multiple presses to advance through the rainbow available. You can change the color of a button any time just by pushing it and cycling through the color palette.

https://youtu.be/42A9ugsNwcg

# NeoTrellis Light Painting

## Customization

The colors are defined in the code as RED, ORANGE, YELLOW, OLIVE, GREEN, AQUA, TEAL, BLUE, NAVY, MAROON, PURPLE, PINK, WHITE, and BLACK. You can change the value of any of these colors by changing the hexadecimal code next to the name.

Use any text editor to change the code. We suggest the Mu editor but you can use any editor that saves plain text. [See this guide on installing Mu](https://learn.adafruit.com/welcome-to-circuitpython/installing-mu-editor).

What values are good? I like to use the [color picker at&nbsp;w3schools.com](https://www.w3schools.com/colors/colors_picker.asp) to make choices. Get the 6 digit alphanumeric (hexadecimal) code and put it after the # (which tells CircuitPython that the number following it is hexadecimal).

If you are adventurous, you can add or delete colors from `color_cycle`, just keep `BLACK` & `WHITE` where they are and change the variable `colors` to the number of colors in `color_cycle` including `BLACK` & `WHITE`.

The code looks for key pressed events and selects the next color in the palette when it detects a key has been pressed.&nbsp;

There is no save/load in the code but you can look to modify the code as you'd like.


## Featured Products

### Adafruit NeoTrellis M4 with Enclosure and Buttons Kit Pack

[Adafruit NeoTrellis M4 with Enclosure and Buttons Kit Pack](https://www.adafruit.com/product/4020)
So you've got a cool/witty name for your band, a Soundcloud account,&nbsp;[a 3D-printed Daft Punk helmet](https://learn.adafruit.com/3d-printed-daft-punk-helmet-with-bluetooth)...&nbsp;so what could be missing from your road to stardom? The **NeoTrellis M4 Kit...**

Out of Stock
[Buy Now](https://www.adafruit.com/product/4020)
[Related Guides to the Product](https://learn.adafruit.com/products/4020/guides)
### USB cable - USB A to Micro-B

[USB cable - USB A to Micro-B](https://www.adafruit.com/product/592)
This here is your standard A to micro-B USB cable, for USB 1.1 or 2.0. Perfect for connecting a PC to your Metro, Feather, Raspberry Pi or other dev-board or microcontroller

Approximately 3 feet / 1 meter long

In Stock
[Buy Now](https://www.adafruit.com/product/592)
[Related Guides to the Product](https://learn.adafruit.com/products/592/guides)
### USB Battery Pack - 2200 mAh Capacity - 5V 1A Output

[USB Battery Pack - 2200 mAh Capacity - 5V 1A Output](https://www.adafruit.com/product/1959)
A smaller-sized rechargeable battery pack for your&nbsp;[Raspberry Pi](http://www.adafruit.com/raspberrypi)&nbsp;or [Raspberry Pi B+](https://www.adafruit.com/product/1914)&nbsp;(or&nbsp;[Arduino](http://www.adafruit.com/arduino), or&nbsp;<a...></a...>

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/1959)
[Related Guides to the Product](https://learn.adafruit.com/products/1959/guides)

## Related Guides

- [NeoTrellis M4 Bumper](https://learn.adafruit.com/neotrellis-m4-bumper.md)
- [NeoTrellis Tabletop RPG Soundboard](https://learn.adafruit.com/neotrellis-dungeon-crawl-soundboard.md)
- [Trellis M4 Beat Sequencers](https://learn.adafruit.com/trellis-m4-beat-sequencer.md)
- [NeoTrellis M4 Memory Game](https://learn.adafruit.com/neotrellis-m4-memory-game.md)
- [What is Web MIDI & BLE MIDI?](https://learn.adafruit.com/web-ble-midi.md)
- [Christmas Soundboard with NeoTrellis M4](https://learn.adafruit.com/xmas-sound-board.md)
- [ABC Soundboards with NeoTrellis](https://learn.adafruit.com/abc-soundboards-with-neotrellis.md)
- [NeoTrellis M4 MIDI File Synthesizer](https://learn.adafruit.com/neotrellism4-midi-file-player-synthesizer.md)
- [Bringing Back THE VOICE of Speak & Spell](https://learn.adafruit.com/bringing-back-the-voice-of-speak-spell.md)
- [Neotrellis M4 Live Launcher](https://learn.adafruit.com/neotrellis-live-launcher.md)
- [Make It Talk](https://learn.adafruit.com/make-it-talk.md)
- [Program CircuitPython USB Devices with iPhone & iPad](https://learn.adafruit.com/use-circuitpython-devices-with-iphone-ipad.md)
- [NeoTrellis M4 Noisy Grains of Sand](https://learn.adafruit.com/neotrellism4sand.md)
- [Classic MIDI Synth Control with Trellis M4](https://learn.adafruit.com/classic-midi-synth-control-with-trellis-m4.md)
- [NeoTrellis M4 Animated Dice Roller](https://learn.adafruit.com/neotrellis-dice.md)
