Library that can read an array of 8x3 reflectance sensors.
Dependencies: DigitalInOut2
Dependents: line_sensors_to_serial_24 R5
Fork of LineSensors by
Diff: LineSensors.h
- Revision:
- 0:acd430185ac0
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LineSensors.h Tue Oct 14 18:03:59 2014 +0000 @@ -0,0 +1,24 @@ +#include "mbed.h" +#include "DigitalInOut2.h" + +#ifndef LINESENSORS_H +#define LINESENSORS_H + +class LineSensors{ + protected: + PinName sensors[8][3]; + int sensVal[8][3]; + int thresh[8][3]; + Timer timer; + uint32_t timeOut; + + public: + LineSensors(PinName, PinName, PinName, PinName, PinName, PinName, PinName, PinName, + PinName, PinName, PinName, PinName, PinName, PinName, PinName, PinName, + PinName, PinName, PinName, PinName, PinName, PinName, PinName, PinName); + void setThreshold(); + void read(); + void lineDetect(bool[8][3]); +}; + +#endif \ No newline at end of file