Firmware for Arduino Adafruit Matrix Portal M4 - microsoft/ExpressivePixels GitHub Wiki
The Expressive Pixels firmware for Arduino will run full featured on the Adafruit Matrix Portal M4 board, supporting connectivity and control from the Expressive Pixels authoring application.
Some of the features supported:
- Live! rendering of animations and authoring from the Expressive Pixels application.
- Upload and storage of animations on the Matrix Portal M4 flash chip
- Auto-play of stored animations upon boot
- Animation triggering from GPIO pins A1, A2, A3, A4
Use existing pre-compiled firmware image
You quickly upload the latest Expressive Pixels firmware image for the Matrix Portal M4 device:
- Put the device into UF2 Bootloader mode by double clicking the device's Reset button, a Windows File Explorer window will appear.
- Download the Expressive Pixels for Matrix Portal M4 firmware, and drag it to the Windows File Explorer window.
- You can now connect to the device using the Expressive Pixels application per section below.
How to build the firmware using the Arduino IDE
-
Install the latest Arduino IDE
-
Ensure you have the Adafruit Matrix Portal M4 (SAMD51) board selected (you will need to ensure you add this board)
-
Install the latest Expressive Pixels Arduino Core Library
-
Install the latest Expressive Pixels Arduino Platform Library
-
Install the latest LittleFS Library
-
Install the latest Adafruit SPI Flash Library
-
Install the latest Adafruit SDFat Library
-
Install the latest Adafruit Bus IO Library
-
Install the latest Adafruit Protomatter Display Library
-
Install the latest Adafruit GFX Library
-
Install the latest Adafruit DotStar Library
-
Install the latest Adafruit Neopixel library
-
Within the Arduino IDE open the ExpressivePixelsFull.ino project
-
The example application currently supports a 64x32 matrix display, to add new resolution open up CONFIG.H and add a new DISPLAY_ definition, copying references to DISPLAY_MATRIX64x32 in both CONFIG.H and EXPRESSIVEPIXELSFULL.INO
-
Ensure TinyUSB is selected as the USB Stack
-
Build!!
-
Upload!!
(Optional) Create UF2 image from Arduino IDE
To easily flash your device(s) over USB you can create a UF2 file instead of uploading a compiled image from the Arduino IDE
-
In the Arduino IDE, select the Sketch..Export Compiled Binary menu item, this will compile a BIN file in your sketch folder
-
Ensure you have Python installed on your system, and copy uf2conv.py into your system path
-
Run the following command which will produce a UF2 file that you can use with the UF2 bootloader on the device
uf2conv.py -c -b 0x4000 -o ExpressivePixels-Arduino-MatrixPortalM4.uf2 ExpressivePixels.ino.matrixportal_m4.bin
How to use the Matrix Portal M4 with the Expressive Pixels application
Connecting to the device
With the Matrix Portal M4 plugged into USB, open up the Expressive Pixels application and open the Devices panel, hover over the Matrix Portal M4 device on COMx, and click the Connect button.
Once the device is connected, from within the app you can hover over the animations displayed in My Animations or the Community Gallery and the animations will play on the Matrix Portal display.
Storing animations on the device
When connected, animations can be stored on the device by selecting the ellipsis button for the animation you wish to store, then select Store to device. The stored animations can be viewed and played in the Animations stored on device view.
Triggering animations
Animations can be externally triggered via one of the 4 GPIO inputs available on the Matrix Portal M4 board. Trigger associations can be made through the Developer Console view.
To make an association:
- Open the Developer Console view
- Type ? into the text entry bar at the bottom of the view, which will display the available console options
- To make a trigger association used the SWITCHACTIVATION ADD command, followed by the GPIO pin and the animation name
- When the GPIO pin is connected to Ground the animation will display on the device.
Bluetooth activation
Bluetooth activation will be enabled on Arduino shortly