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-18
Branch:
Drift
Revision:
82:992ba6f31e24
Parent:
80:c85cb93713b3
Child:
86:51048c1f132f

File content as of revision 82:992ba6f31e24:

#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)
    {
        
    }
}

void StandbyState::TouchIrqCallback()
{
    
}