Skip to content

Commit

Permalink
Merge pull request #15 from sqfmi/1.1.9
Browse files Browse the repository at this point in the history
added Tetris
  • Loading branch information
sqfmi authored Jan 18, 2021
2 parents ee77c1f + 609c839 commit 2be1622
Show file tree
Hide file tree
Showing 6 changed files with 585 additions and 1 deletion.
9 changes: 9 additions & 0 deletions examples/WatchFaces/Tetris/Tetris.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include "Watchy_Tetris.h"

WatchyTetris watchy;

void setup(){
watchy.init();
}

void loop(){}
18 changes: 18 additions & 0 deletions examples/WatchFaces/Tetris/Watchy_Tetris.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include "Watchy_Tetris.h"

const unsigned char *tetris_nums [10] = {tetris0, tetris1, tetris2, tetris3, tetris4, tetris5, tetris6, tetris7, tetris8, tetris9};

WatchyTetris::WatchyTetris(){} //constructor

void WatchyTetris::drawWatchFace(){
display.fillScreen(GxEPD_WHITE);
display.drawBitmap(0, 0, tetrisbg, DISPLAY_WIDTH, DISPLAY_HEIGHT, GxEPD_BLACK);

//Hour
display.drawBitmap(25, 20, tetris_nums[23/10], 40, 60, GxEPD_BLACK); //first digit
display.drawBitmap(75, 20, tetris_nums[23%10], 40, 60, GxEPD_BLACK); //second digit

//Minute
display.drawBitmap(25, 110, tetris_nums[45/10], 40, 60, GxEPD_BLACK); //first digit
display.drawBitmap(75, 110, tetris_nums[45%10], 40, 60, GxEPD_BLACK); //second digit
}
13 changes: 13 additions & 0 deletions examples/WatchFaces/Tetris/Watchy_Tetris.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#ifndef WATCHY_TETRIS_H
#define WATCHY_TETRIS_H

#include <Watchy.h>
#include "tetris.h"

class WatchyTetris : public Watchy{
public:
WatchyTetris();
void drawWatchFace();
};

#endif
Loading

0 comments on commit 2be1622

Please sign in to comment.