-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
59 additions
and
16 deletions.
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,19 @@ | ||
#ifndef TOMO_APP_H | ||
#define TOMO_APP_H | ||
|
||
#include <tomo_scene.h> | ||
|
||
typedef enum { | ||
TOMO_BLINK, | ||
TOMO_LEFT, | ||
TOMO_REST, | ||
TOMO_RIGHT | ||
} tomo_facial_animation; | ||
|
||
class TomoApp final { | ||
public: | ||
static void setupUtilities(); | ||
static void run(); | ||
}; | ||
|
||
#endif |
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 |
---|---|---|
@@ -1,24 +1,11 @@ | ||
#include <scenes/tomo_blink.h> | ||
#include <scenes/tomo_left.h> | ||
#include <scenes/tomo_rest.h> | ||
#include <scenes/tomo_right.h> | ||
|
||
#include <tomo_app.h> | ||
#include <tomo_display.h> | ||
#include <tomo_scene.h> | ||
|
||
void setup() { | ||
TomoScene::initializeTouchPin(); | ||
if(!TomoDisplay::initialize()) | ||
while(true); | ||
|
||
TomoApp::setupUtilities(); | ||
TomoDisplay::renderSplashScreen(); | ||
TomoScene::renderScene<TomoBlinkScene>(3); | ||
TomoScene::renderScene<TomoLeftScene>(1); | ||
TomoScene::renderScene<TomoRightScene>(1); | ||
TomoScene::renderScene<TomoBlinkScene>(2); | ||
TomoScene::renderScene<TomoRestScene>(1); | ||
} | ||
|
||
void loop() { | ||
vTaskDelay(10); | ||
TomoApp::run(); | ||
} |
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,37 @@ | ||
#include <scenes/tomo_blink.h> | ||
#include <scenes/tomo_left.h> | ||
#include <scenes/tomo_rest.h> | ||
#include <scenes/tomo_right.h> | ||
|
||
#include <tomo_app.h> | ||
#include <tomo_rng_engine.h> | ||
|
||
void TomoApp::setupUtilities() { | ||
TomoScene::initializeTouchPin(); | ||
TomoRNGEngine::initializeEngine(); | ||
|
||
if(!TomoDisplay::initialize()) | ||
while(true); | ||
} | ||
|
||
void TomoApp::run() { | ||
switch(TomoRNGEngine::get(0, 3)) { | ||
case TOMO_BLINK: | ||
TomoScene::renderScene<TomoBlinkScene>( | ||
TomoRNGEngine::get(0, 6) | ||
); | ||
break; | ||
|
||
case TOMO_LEFT: | ||
TomoScene::renderScene<TomoLeftScene>(1); | ||
break; | ||
|
||
case TOMO_REST: | ||
TomoScene::renderScene<TomoRestScene>(1); | ||
break; | ||
|
||
case TOMO_RIGHT: | ||
TomoScene::renderScene<TomoRightScene>(1); | ||
break; | ||
} | ||
} |