Dependencies:   mbed MODSERIAL FATFileSystem

Committer:
tnhnrl
Date:
Thu Feb 15 02:39:13 2018 +0000
Revision:
45:16b8162188ca
Parent:
21:38c8544db6f4
Child:
82:0981b9ada820
version for USB testing with reduced class sizes

Who changed what in which revision?

UserRevisionLine numberNew contents of line
tnhnrl 17:7c16b5671d0e 1 #include "mbed.h"
tnhnrl 17:7c16b5671d0e 2 #include "ConfigFile.h"
tnhnrl 17:7c16b5671d0e 3 #include <string> //mbed doesn't use cstring
tnhnrl 17:7c16b5671d0e 4
tnhnrl 17:7c16b5671d0e 5 #ifndef SEQUENCECONTROLLER_HPP
tnhnrl 17:7c16b5671d0e 6 #define SEQUENCECONTROLLER_HPP
tnhnrl 17:7c16b5671d0e 7
tnhnrl 17:7c16b5671d0e 8 //struct for saving the data
tnhnrl 17:7c16b5671d0e 9 struct sequenceStruct {
tnhnrl 17:7c16b5671d0e 10 string title;
tnhnrl 17:7c16b5671d0e 11 int state; //for the current StateMachine, states are ID-ed with enumeration
tnhnrl 17:7c16b5671d0e 12 float timeout;
tnhnrl 17:7c16b5671d0e 13 float depth;
tnhnrl 17:7c16b5671d0e 14 float pitch;
tnhnrl 17:7c16b5671d0e 15 };
tnhnrl 17:7c16b5671d0e 16
tnhnrl 17:7c16b5671d0e 17 class SequenceController {
tnhnrl 17:7c16b5671d0e 18 public:
tnhnrl 17:7c16b5671d0e 19 SequenceController();
tnhnrl 17:7c16b5671d0e 20
tnhnrl 17:7c16b5671d0e 21 sequenceStruct sequenceStructLoaded[256];
tnhnrl 17:7c16b5671d0e 22
tnhnrl 17:7c16b5671d0e 23 void loadSequence();
tnhnrl 17:7c16b5671d0e 24
tnhnrl 17:7c16b5671d0e 25 sequenceStruct process(string input_string);
tnhnrl 17:7c16b5671d0e 26
tnhnrl 17:7c16b5671d0e 27 void sequenceFunction(); //process the sequence
tnhnrl 17:7c16b5671d0e 28
tnhnrl 17:7c16b5671d0e 29 void setState(int input_state); //manually set the state of the system
tnhnrl 17:7c16b5671d0e 30 int getState();
tnhnrl 17:7c16b5671d0e 31 void setTimeout(float input_timeout);
tnhnrl 17:7c16b5671d0e 32 void setDepthCommand(float input_depth_command);
tnhnrl 17:7c16b5671d0e 33 void setPitchCommand(float input_pitch_command);
tnhnrl 17:7c16b5671d0e 34
tnhnrl 17:7c16b5671d0e 35 int getSequenceState();
tnhnrl 17:7c16b5671d0e 36
tnhnrl 17:7c16b5671d0e 37 private:
tnhnrl 17:7c16b5671d0e 38 char _neutral_sequence;
tnhnrl 17:7c16b5671d0e 39 char _dive_cycle;
tnhnrl 17:7c16b5671d0e 40 char _exit;
tnhnrl 17:7c16b5671d0e 41
tnhnrl 17:7c16b5671d0e 42 int _number_of_sequences;
tnhnrl 17:7c16b5671d0e 43 int _sequence_counter;
tnhnrl 17:7c16b5671d0e 44
tnhnrl 17:7c16b5671d0e 45 Ticker sequenceTicker; //Ticker for the sequenceFunction
tnhnrl 17:7c16b5671d0e 46
tnhnrl 17:7c16b5671d0e 47 int _current_state;
tnhnrl 17:7c16b5671d0e 48 };
tnhnrl 17:7c16b5671d0e 49 #endif