Snake game for a 5x5 LED matrix
Embed:
(wiki syntax)
Show/hide line numbers
ledCube.h
00001 #include "mbed.h" 00002 #include "MCP23S17.h" 00003 00004 #ifndef LEDCUBE_H 00005 #define LEDCUBE_H 00006 /* 00007 Class to represent the LED cube as a whole. Can light and select LEDs 00008 */ 00009 class ledCube 00010 { 00011 public: 00012 DigitalOut *ledArray[5][5]; 00013 SPI *spi; 00014 MCP23S17 *chip; 00015 int numRows, numCols; 00016 ledCube(); 00017 void turnOnLed(char row, char column, char layer); 00018 void turnOffLed(char row, char column, char layer); 00019 void blink(); 00020 unsigned char spiCurrentlyLit; 00021 00022 private: 00023 DigitalOut *lastLedLit; 00024 }; 00025 00026 #endif //LEDCUBE_H
Generated on Wed Jul 13 2022 02:48:01 by 1.7.2