![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Colour sensors calibrated
Dependencies: mbed-rtos mbed Servo QEI
Fork of ICRSEurobot13 by
Diff: Sensors/Colour/Colour.h
- Revision:
- 45:77cf6375348a
- Parent:
- 21:c592bf6a6a2d
diff -r 555136de33e4 -r 77cf6375348a Sensors/Colour/Colour.h --- a/Sensors/Colour/Colour.h Fri Apr 12 16:46:42 2013 +0000 +++ b/Sensors/Colour/Colour.h Fri Apr 12 20:40:52 2013 +0000 @@ -1,9 +1,11 @@ // Eurobot13 Colour.h - +#ifndef COLOUR_H +#define COLOUR_H #include "mbed.h" #include "globals.h" +#include "math.h" #define BUFF_SIZE 10 #define SNR_THRESHOLD_DB 4 @@ -17,25 +19,38 @@ class Colour{ public: + Colour( PinName blue_led, PinName red_led, PinName pt, ArmEnum arm); - ColourEnum getColour(); + virtual ColourEnum getColour(); private: - Ticker _ticker; - DigitalOut _blue_led; - DigitalOut _red_led; - AnalogIn _pt; - ArmEnum _arm; + Ticker ticker; + DigitalOut blue_led; + DigitalOut red_led; + AnalogIn pt; + ArmEnum arm; float red_correction_factor; - double _colour; - double _SNR; - void _Blink (void); + float colour; + float SNR; + void Blink(); -}; \ No newline at end of file + int togglecolour; + float blue; + float blue_buff[BUFF_SIZE]; + float red; + float red_buff[BUFF_SIZE]; + float noise; + float noise_buff[BUFF_SIZE]; + + int buff_pointer; + +}; + +#endif \ No newline at end of file