init
Dependencies: MPU6050 PinDetect circular_buffer
Diff: MotionFSM/Fsm.cpp
- Revision:
- 0:b416214256cd
diff -r 000000000000 -r b416214256cd MotionFSM/Fsm.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MotionFSM/Fsm.cpp Tue Nov 07 16:35:14 2017 +0000 @@ -0,0 +1,45 @@ +#include <Moving.h> +#include <Stacionary.h> +#include <Fsm.h> + +FsmStates::FsmStates() : movingState_(new Moving(*this,timer)), + stacionaryState_(new Stacionary(*this,timer)) +{ + currentState(stacionaryState()); +} + + + +State* FsmStates::stacionaryState() +{ + return stacionaryState_; +} + +State* FsmStates::movingState() +{ + return movingState_; +} + +State* FsmStates::currentState() +{ + return currentState_; +} +void FsmStates::currentState(State* state) +{ + currentState_ = state; +} + +FsmStates::~FsmStates() +{ + delete stacionaryState_; + delete movingState_; +} + +Fsm::Fsm() : states_() +{ + + +} + + +