PixelMatrix is a project that uses an LED matrix to display various animations and games. The project leverages an ESP8266 for controlling the LED matrix, allowing for dynamic and interactive displays. The system is designed to be extensible, making it easy to add new animations and applications.
- Power up your LED Matrix: Ensure your device is powered on and ready.
- Connect to the Hotspot: On your Wi-Fi-enabled device, search for and connect to the Wi-Fi hotspot named
PixelMatrix
followed by the PixelCode displayed on the bottom right. - Start Playing: After the connection is established a browser window with the controls should pop up. If not navigate to
matrix.local
ormatrix.de
You have two options to create an application for the led matrix.
- 1 (Prefered) You use the Editor and use a customized scripting language similar to javascript to write a program for the led matrix
- 2 You hard code the application into the system application (cons: Local setup needed, long compile times, harder to learn)
- Create a new Project: Create a new Project at https://matrix.tim-arnold.de
- Select the new template
After a wifi connection as described in Using the hotspot is established, you can reload the connection in the Matrix Connection box.
You can check the cheatsheet in the help section or start with an example to see all commands and functions available.
- Create a Class: Define a new class that inherits from
Application
. - Implement Required Methods: Implement the following virtual methods:
init(MatrixManager *mm, ControlManager *cm)
draw(MatrixManager *mm, ControlManager *cm)
game_loop(MatrixManager *mm, ControlManager *cm)
clean_up(MatrixManager *mm)
on_event(Event e, MatrixManager *mm, ControlManager *cm)
#include "system/Application.h"
class MyApp : public Application {
public:
void init(MatrixManager *mm, ControlManager *cm) override {
// Initialize application
}
void draw(MatrixManager *mm, ControlManager *cm) override {
// Draw application frame
// do not allocate new memory here
// runs at ~30 fps
}
void game_loop(MatrixManager *mm, ControlManager *cm) override {
// Update application logic
// runs at the specified frequency in MatrixManager->set_tps (Ticks per Second)
}
void clean_up(MatrixManager *mm) override {
// Clean up resources
}
void on_event(Event e, MatrixManager *mm, ControlManager *cm) override {
// Handle events
}
static Application* create() {
return new MyApp();
}
};
In the setup()
function of main.cpp
, register your application with the SystemManager
:
void setup() {
sm.register_application(MyApp::create, "MyApp", "AuthorName");
}
The MatrixManager
controls the LED matrix, providing methods to set pixels and draw shapes.
// Set a pixel at (x, y) to a specific color
mm->set(x, y, color);
// Turn off a specific pixel
mm->off(x, y);
// Draw a circle
mm->circle(x, y, radius, color, filled, thickness);
// find more methods in the doxygen documentation
The ControlManager
manages the controls and status of your application. It also runs animations.
// Set the status displayed on the webpage
cm->set_status("Running");
// Get the current controls displayed to the user
uint8_t controls = cm->get_controls();
// Run an animation
cm->run_animation(new MyAnimation(), 1000);
// find more methods in the doxygen documentation
Download firmware here: firmware.bin
- Connect to the Device: Ensure your device is connected to the LED Matrix.
- Navigate to the Update Page: Open a web browser and navigate to
http://matrix.local/update
. - Upload Firmware: Follow the on-screen instructions to upload your new firmware.
info@wri-obernburg