Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: BSP_DISCO_F746NG F746_GUI LCD_DISCO_F746NG SDFileSystem TS_DISCO_F746NG ResistiveTouchController Map CYS8218Controller MedianFilter
Screens/ManualControlScreen.cpp
- Committer:
- Kerneels Bezuidenhout
- Date:
- 2016-10-02
- Revision:
- 11:e3e259474d2b
- Child:
- 14:5beb6b4850b7
File content as of revision 11:e3e259474d2b:
#include "ManualControlScreen.hpp" ManualControlScreen::ManualControlScreen(int *nextScreen, float *alpha, float *beta) : Screen(), _lbTitle( SCREEN_W/2, 0, "Manual", Label::CENTER, Font24), _btBack( 0, SCREEN_H-30, 100, 30, "Back"), _btReset( SCREEN_W-100, SCREEN_H-30, 100, 30, "Reset"), _tpManual( (SCREEN_W/2)-104, 29, 208 208, -10.0,10.0,-10.0,10.0, 5) { _nextScreen = nextScreen; _alpha = alpha; _beta = beta; } void ManualControlScreen::Draw() { Clear(), _lbTitle.Draw(); _btBack.Draw(); _btReset.Draw(); _tpManual.Draw(); } void ManualControlScreen::Process() { if( _btBack.Touched() ) *_nextScreen = MAIN_MENU_SCREEN; if( _btReset.Touched() ) { _btReset.Draw(); _tpManual.Reset(); SetValues(); Thread::wait(200); } if( _tpManual.Touched() ) { _tpManual.Update(); SetValues(); Thread::wait(20); } } void ManualControlScreen::SetValues() { *_alpha = _tpManual.GetX(); *_beta = _tpManual.GetY(); }