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
StateMachine/TestingState.h@86:51048c1f132f, 2017-04-19 (annotated)
- Committer:
- hazheng
- Date:
- Wed Apr 19 03:46:21 2017 +0000
- Branch:
- Drift
- Revision:
- 86:51048c1f132f
- Parent:
- 82:992ba6f31e24
- Child:
- 97:0ed9ede9a995
Only finished docs for states and state machine.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
hazheng | 86:51048c1f132f | 1 | /** |
hazheng | 86:51048c1f132f | 2 | * @file TestingState.h |
hazheng | 86:51048c1f132f | 3 | * @brief The header file for the TestingState class. |
hazheng | 86:51048c1f132f | 4 | * @author Jordan Brack <jabrack@mix.wvu.edu>, Haofan Zheng <hazheng@mix.wvu.edu> |
hazheng | 86:51048c1f132f | 5 | * |
hazheng | 86:51048c1f132f | 6 | */ |
hazheng | 82:992ba6f31e24 | 7 | #pragma once |
hazheng | 82:992ba6f31e24 | 8 | #ifndef TESTING_STATE_H |
hazheng | 82:992ba6f31e24 | 9 | #define TESTING_STATE_H |
hazheng | 82:992ba6f31e24 | 10 | |
hazheng | 82:992ba6f31e24 | 11 | #include <mbed.h> |
hazheng | 82:992ba6f31e24 | 12 | #include "States.h" |
hazheng | 82:992ba6f31e24 | 13 | |
hazheng | 86:51048c1f132f | 14 | /** |
hazheng | 86:51048c1f132f | 15 | * @class TestingState |
hazheng | 86:51048c1f132f | 16 | * @brief The class for testing state. It is a child class of the States class. |
hazheng | 86:51048c1f132f | 17 | * |
hazheng | 86:51048c1f132f | 18 | */ |
hazheng | 82:992ba6f31e24 | 19 | class TestingState : public States |
hazheng | 82:992ba6f31e24 | 20 | { |
hazheng | 82:992ba6f31e24 | 21 | public: |
hazheng | 86:51048c1f132f | 22 | /** |
hazheng | 86:51048c1f132f | 23 | * @brief This is the constructor for the TestingState class |
hazheng | 86:51048c1f132f | 24 | */ |
hazheng | 82:992ba6f31e24 | 25 | TestingState(); |
hazheng | 86:51048c1f132f | 26 | /** |
hazheng | 86:51048c1f132f | 27 | * @brief This is the destructor for the TestingState class |
hazheng | 86:51048c1f132f | 28 | */ |
hazheng | 82:992ba6f31e24 | 29 | ~TestingState(); |
hazheng | 82:992ba6f31e24 | 30 | |
hazheng | 86:51048c1f132f | 31 | /** |
hazheng | 86:51048c1f132f | 32 | * @brief Draw the user interface. This function is called only once, whenever the testing state becomes the current state. |
hazheng | 86:51048c1f132f | 33 | */ |
hazheng | 82:992ba6f31e24 | 34 | virtual void DrawUserInterface(); |
hazheng | 82:992ba6f31e24 | 35 | |
hazheng | 86:51048c1f132f | 36 | /** |
hazheng | 86:51048c1f132f | 37 | * @brief This functino will be called during every tick, only if the testing state is the current state. |
hazheng | 86:51048c1f132f | 38 | * @param deltaTime The time interval between last tick and current tick. |
hazheng | 86:51048c1f132f | 39 | */ |
hazheng | 82:992ba6f31e24 | 40 | virtual void Update(float deltaTime); |
hazheng | 82:992ba6f31e24 | 41 | |
hazheng | 86:51048c1f132f | 42 | /** |
hazheng | 86:51048c1f132f | 43 | * @brief Return wether or not the testing state has a position callback function for the touch screen. |
hazheng | 86:51048c1f132f | 44 | * @return 0 for not, 1 for yes. |
hazheng | 86:51048c1f132f | 45 | */ |
hazheng | 82:992ba6f31e24 | 46 | virtual uint8_t HasTouchPosFunction() const; |
hazheng | 82:992ba6f31e24 | 47 | |
hazheng | 86:51048c1f132f | 48 | /** |
hazheng | 86:51048c1f132f | 49 | * @brief Return wether or not the testing state has a interrupt callback function for the touch screen. |
hazheng | 86:51048c1f132f | 50 | * @return 0 for not, 1 for yes. |
hazheng | 86:51048c1f132f | 51 | */ |
hazheng | 82:992ba6f31e24 | 52 | virtual uint8_t HasTouchIrqFunction() const; |
hazheng | 82:992ba6f31e24 | 53 | |
hazheng | 86:51048c1f132f | 54 | /** |
hazheng | 86:51048c1f132f | 55 | * @brief The position callback function for the touch screen. Based on the touch position, the corresponding functionality will be executed. |
hazheng | 86:51048c1f132f | 56 | */ |
hazheng | 82:992ba6f31e24 | 57 | virtual void TouchPosCallback(int16_t x, int16_t y); |
hazheng | 82:992ba6f31e24 | 58 | |
hazheng | 86:51048c1f132f | 59 | /** |
hazheng | 86:51048c1f132f | 60 | * @brief The interrupt callback function for the touch screen. |
hazheng | 86:51048c1f132f | 61 | */ |
hazheng | 82:992ba6f31e24 | 62 | virtual void TouchIrqCallback(); |
hazheng | 82:992ba6f31e24 | 63 | }; |
hazheng | 82:992ba6f31e24 | 64 | |
hazheng | 82:992ba6f31e24 | 65 | #endif //TESTING_STATE_H |