Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed-rtos mbed QEI
Diff: Sensors/Colour/Colour.h
- Revision:
- 7:4340355261f9
- Parent:
- 5:56a5fdd373c9
- Child:
- 43:c592bf6a6a2d
diff -r 995b3679155f -r 4340355261f9 Sensors/Colour/Colour.h
--- a/Sensors/Colour/Colour.h Fri Apr 05 15:45:00 2013 +0000
+++ b/Sensors/Colour/Colour.h Fri Apr 05 16:37:36 2013 +0000
@@ -5,16 +5,14 @@
//blue led use 10ohm
#include "mbed.h"
-#include "Led.h"
-#include "Phototransistor.h"
enum ColourEnum {BLUE, RED, WHITE, INCONCLUSIVE, BUG};
class Colour{
private:
- Led blue; float bavg, bstdev;
- Led red; float ravg, rstdev;
- Phototransistor pt;
+ DigitalOut blue; float bavg, bstdev;
+ DigitalOut red; float ravg, rstdev;
+ AnalogIn pt;
public:
Colour(PinName bluePin, PinName redPin, PinName phototransistorPin)
@@ -46,8 +44,8 @@
}
private:
- void LedsOff(){blue.off(); red.off();}
- void ReadLed (Led &led, float &avg, float &stdev, const int measureNum = 25); // Colour.cpp
- bool isColour(Led &led, const float &avg, const float &stdev, const float numstddev = 2); // Colour.cpp
+ void LedsOff(){blue = 0; red = 0;}
+ void ReadLed (DigitalOut &led, float &avg, float &stdev, const int measureNum = 25); // Colour.cpp
+ bool isColour(DigitalOut &led, const float &avg, const float &stdev, const float numstddev = 2); // Colour.cpp
};
\ No newline at end of file