![](/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.cpp
- Revision:
- 7:4340355261f9
- Parent:
- 4:1be0f6c6ceae
- Child:
- 21:c592bf6a6a2d
diff -r 995b3679155f -r 4340355261f9 Sensors/Colour/Colour.cpp --- a/Sensors/Colour/Colour.cpp Fri Apr 05 15:45:00 2013 +0000 +++ b/Sensors/Colour/Colour.cpp Fri Apr 05 16:37:36 2013 +0000 @@ -3,9 +3,9 @@ #include "Colour.h" -void Colour::ReadLed (Led &led, float &avg, float &stdev, const int measureNum){ +void Colour::ReadLed (DigitalOut &led, float &avg, float &stdev, const int measureNum){ LedsOff(); - led.on(); + led = 1; double x = 0, x2 = 0; for (int i = measureNum; i != 0; i--) { float v = pt.read(); @@ -18,7 +18,7 @@ //pc.printf("Phototransistor Analog is: %f\t%f\n\r", avg, stdev); } -bool Colour::isColour(Led &led, const float &avg, const float &stdev, const float numstddev){ +bool Colour::isColour(DigitalOut &led, const float &avg, const float &stdev, const float numstddev){ float avg2, stdev2; ReadLed(led, avg2, stdev2);