/* Arduino Uno R4 WiFi LED Matrix Extension - Version 1 - 27th June 2023 */ #include "Arduino_LED_Matrix.h" ArduinoLEDMatrix matrix; /* (matrix-begin) Initialise LED matrix. */ object *fn_MatrixBegin (object *args, object *env) { (void) args, (void) env; matrix.begin(); return nil; } /* (turn-led led on) Turns on or off the specified led number, 0 to 95. */ object *fn_TurnLed (object *args, object *env) { (void) env; turnLed(checkinteger(first(args)), (second(args) != nil)); return nil; } /* (load-frame one two three) Displays a static pattern of LEDs specified by the three 32-bit parameters. */ object *fn_LoadFrame (object *args, object *env) { (void) env; uint32_t frame[3]; frame[0] = checkinteger(first(args)); frame[1] = checkinteger(second(args)); frame[2] = checkinteger(third(args)); matrix.loadFrame(frame); return nil; } // Symbol names const char stringMatrixBegin[] PROGMEM = "matrix-begin"; const char stringTurnLed[] PROGMEM = "turn-led"; const char stringLoadFrame[] PROGMEM = "load-frame"; // Documentation strings const char docMatrixBegin[] PROGMEM = "(matrix-begin)\n" "Initialise LED matrix."; const char docTurnLed[] PROGMEM = "(turn-led led on)\n" "Turns on or off the specified led number, 0 to 95."; const char docLoadFrame[] PROGMEM = "(load-frame one two three)\n" "Displays a static bit pattern."; // Symbol lookup table const tbl_entry_t lookup_table2[] PROGMEM = { { stringMatrixBegin, fn_MatrixBegin, 0200, docMatrixBegin }, { stringTurnLed, fn_TurnLed, 0222, docTurnLed }, { stringLoadFrame, fn_LoadFrame, 0233, docLoadFrame } }; // Table cross-reference functions - do not edit below this line tbl_entry_t *tables[] = {lookup_table, lookup_table2}; const unsigned int tablesizes[] = { arraysize(lookup_table), arraysize(lookup_table2) }; const tbl_entry_t *table (int n) { return tables[n]; } unsigned int tablesize (int n) { return tablesizes[n]; }