SmartWheels self-driving race car. Designed for NXP Cup. Uses FRDM-KL25Z, area-scan camera, and simple image processing to detect and navigate any NXP spec track.

Dependencies:   TSI USBDevice mbed-dev

Fork of SmartWheels by haofan Zheng

StateMachine/StandbyState.cpp

Committer:
hazheng
Date:
2017-04-19
Branch:
Drift
Revision:
86:51048c1f132f
Parent:
82:992ba6f31e24
Child:
97:0ed9ede9a995

File content as of revision 86:51048c1f132f:

#include "StandbyState.h"

#include "ArduUTFT.h"

#include "StateManager.h"

StandbyState::StandbyState()
{}

StandbyState::~StandbyState()
{
    ardu_utft_print("X", 10, 10);
}

void StandbyState::DrawUserInterface()
{
    ardu_utft_clr_scr();
    
    ardu_utft_set_color(0, 0, 255);
    ardu_utft_fill_rect(10, 10, 310, 110);
    ardu_utft_set_color(255, 255, 255);
    ardu_utft_print("Run", 170, 50);
    
    ardu_utft_set_color(255, 255, 0);
    ardu_utft_fill_rect(10, 130, 310, 230);
    ardu_utft_set_color(255, 255, 255);
    ardu_utft_print("Test system", 200, 180);
}

void StandbyState::Update(float deltaTime)
{
    
}

uint8_t StandbyState::HasTouchPosFunction() const
{
    return 1;
}

uint8_t StandbyState::HasTouchIrqFunction() const
{
    return 0;
}

void StandbyState::TouchPosCallback(int16_t x, int16_t y)
{
    if(y <= 110)
    {
        ardu_utft_print("X", x, y);
        state_manager_switch_state(RUNNING_STATE);
        
    }
    else if(y >= 130)
    {
        
    }
}