Im Januar wird es wieder einen Programmierkurs im WRI Obernburg geben. Teilnehmen können alle, die am Wochenende zuvor eine LED Matrix gebaut haben, oder bereits eine besitzen. Bei Interesse gerne per Email an info@wri-obernburg.de wenden.
- 17.01.2025 14:00 Uhr - 18:00 Uhr: Brainstorming & Gruppenfindung
- 18.01.2025 10:00 Uhr - 15:30 Uhr: Programmierung mit anschließendem Showcase
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
- 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.