NOT FINISHED YET!!! My first try to get a self built fully working Quadrocopter based on an mbed, a self built frame and some other more or less cheap parts.
Diff: RC/RC_Channel.h
- Revision:
- 27:9e546fa47c33
- Parent:
- 15:753c5d6a63b3
- Child:
- 34:3aa1cbcde59d
--- a/RC/RC_Channel.h Tue Nov 27 19:49:38 2012 +0000 +++ b/RC/RC_Channel.h Wed Nov 28 12:29:02 2012 +0000 @@ -6,18 +6,26 @@ class RC_Channel { public: - RC_Channel(PinName mypin); // NO p19/p20!!!!, they don't support InterruptIn + RC_Channel(PinName mypin, int index); // NO p19/p20!!!!, they don't support InterruptIn int read(); // read the last measured data private: + int index; // to know which channel of the RC an instance has + int time; // last measurement data + float scale; // calibration values + float offset; + InterruptIn myinterrupt; // interrupt on the pin to react when signal falls or rises void rise(); // start the time measurement when signal rises void fall(); // stop the time mesurement and save the value when signal falls Timer timer; // timer to measure the up time of the signal and if the signal timed out - int time; // last measurement data Ticker timeoutchecker; // Ticker to see if signal broke down void timeoutcheck(); // to check for timeout, checked every second + + // Calibration value saving + void saveCalibrationValue(float * value, char * fileextension); + void loadCalibrationValue(float * value, char * fileextension); }; #endif \ No newline at end of file