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: mbed QEI HIDScope biquadFilter MODSERIAL FastPWM
Diff: main.cpp
- Revision:
- 6:41b02057fc2c
- Parent:
- 5:77929f5f1f32
- Child:
- 7:af0c16ae48d7
--- a/main.cpp Tue Oct 01 12:50:38 2019 +0000 +++ b/main.cpp Tue Oct 01 13:11:49 2019 +0000 @@ -1,9 +1,17 @@ -//Global variables and objects +//includes +#include "mbed.h" +//objects and variables +DigitalOut ledb(LED_BLUE); // ledb=true is led off!! +DigitalOut ledg(LED_GREEN); +DigitalOut ledr(LED_RED); enum States {MovementIdle, CalibrationIdle, Demo, Startup, CalibrationPhysical, Move, TiltCup, FailState}; States CurrentState; void Run_Demo(void) { + ledg=false; + ledr=true; + ledb=true;//only turns on the green light } @@ -43,8 +51,12 @@ } void Run_FailState(void) -{ - +{ + ledg=true; + ledb=true; + while(true){ + ledr=!ledr; + wait(0.5f); } } //State Machine @@ -56,13 +68,13 @@ Run_Demo; break; case MovementIdle: - Run_MovenmentIdle(); + Run_MovementIdle; break; case CalibrationIdle: Run_CalibrationIdle; break; case Startup; - Run_Startup(); + Run_Startup; break; case CalibrationPhysical: Run_CalibrationPhysical; @@ -84,7 +96,9 @@ //Main Loop int main() -{ +{ ledb=true; + ledr=true; + ledg=true;//turn off all leds CurrentState = Startup; while(true) {