Skip to content

Instantly share code, notes, and snippets.

@electronut
Created October 29, 2017 08:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save electronut/e80b6666676f37e000be06ed2ba2a2ff to your computer and use it in GitHub Desktop.
Save electronut/e80b6666676f37e000be06ed2ba2a2ff to your computer and use it in GitHub Desktop.
stm32-conway.h
class Conway64 {
public:
Conway64(SPI_HandleTypeDef* hSPI);
virtual ~Conway64();
// initialize
void init();
// add glider with top left cell at (i, j)
void addGlider(int i, int j);
void addBlinker(int i, int j);
// update simulation
void update();
// render to LED grid
void render();
// signal to thread
void signal();
// test init SPI
void testInit();
// test SPI
void test();
private:
BitBuf88 _grid;
MAX7219* _max7219;
osThreadId _conwayTaskHandle;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment