Init and setup the matrix. might have some other utility functions

This commit is contained in:
Ryan Voots 2016-04-23 22:37:59 -07:00
parent caf2a89eec
commit fda422524f
3 changed files with 33 additions and 1 deletions

View file

@ -5,16 +5,19 @@
This example code is in the public domain. This example code is in the public domain.
*/ */
#include <cstdlib>
#include "lua.hpp" #include "lua.hpp"
#include "log.h" #include "log.h"
#include "matrix.h"
void setup() { void setup() {
// initialize the digital pin as an output. // initialize the digital pin as an output.
// Pin 13 has an LED connected on most Arduino boards: // Pin 13 has an LED connected on most Arduino boards:
//pinMode(13, OUTPUT); //pinMode(13, OUTPUT);
LogOut.begin(9600); LogOut.begin(9600);
delay(10000); delay(10000); // TODO remove this
setup_matrix();
l_init(); l_init();
} }

16
teensy/matrix.cpp Normal file
View file

@ -0,0 +1,16 @@
#include "matrix.h"
// TODO this needs to setup the panel to actually be in the proper geometry
RGBmatrixPanel matrixpanel(true);
void setup_matrix() {
matrixpanel.begin();
// Some defaults
matrixpanel.setTextWrap(false);
matrixpanel.setFont(&TomThumb);
}
void loop_matrix() {
// I think this might be best left to the lua code? or it'll run between frame draws in there.
// matrix.swapBuffers(false);
}

13
teensy/matrix.h Normal file
View file

@ -0,0 +1,13 @@
#ifndef __LUALIGHTS_LUA_ALLOC_H
#define __LUALIGHTS_LUA_ALLOC_H
#include <Adafruit_GFX.h>
#include <RGBmatrixPanel.h>
#include <Fonts/TomThumb.h>
extern RGBmatrixPanel matrixpanel;
void setup_matrix();
void loop_matrix();
#endif