-
Notifications
You must be signed in to change notification settings - Fork 335
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from sqfmi/1.1.9
added Tetris
- Loading branch information
Showing
6 changed files
with
585 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(){} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.