2016-12-04 18:53:43 +00:00
|
|
|
#include "StateUserUnknown.h"
|
|
|
|
#include "Globals.h"
|
|
|
|
#include "StateDefault.h"
|
|
|
|
|
|
|
|
|
|
|
|
void UserUnknownState::setup()
|
|
|
|
{
|
2016-12-05 22:42:20 +00:00
|
|
|
animationTime = currentTime;
|
|
|
|
animationStep = 0;
|
2016-12-04 18:53:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void UserUnknownState::loop()
|
|
|
|
{
|
|
|
|
if (buttonA->pressed() || buttonB->pressed())
|
|
|
|
{
|
|
|
|
setCurrentState(new DefaultState());
|
|
|
|
}
|
|
|
|
|
2016-12-05 22:42:20 +00:00
|
|
|
if (currentTime - animationTime > 500)
|
|
|
|
{
|
|
|
|
animationStep++;
|
|
|
|
animationTime = currentTime;
|
|
|
|
|
|
|
|
if (animationStep == 12)
|
|
|
|
animationStep = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (animationStep)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
case 2:
|
|
|
|
case 4:
|
|
|
|
{
|
|
|
|
char text[] = "ERROR";
|
|
|
|
display->writeTextLeft(text);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 1:
|
|
|
|
case 3:
|
|
|
|
case 5:
|
|
|
|
{
|
|
|
|
display->clear();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 6:
|
|
|
|
case 7:
|
|
|
|
case 8:
|
|
|
|
{
|
|
|
|
char text[] = "user";
|
|
|
|
display->writeTextLeft(text);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 9:
|
|
|
|
case 10:
|
|
|
|
case 11:
|
|
|
|
{
|
|
|
|
char text[] = "unknwn";
|
|
|
|
display->writeTextLeft(text);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2016-12-04 18:53:43 +00:00
|
|
|
}
|