Library that can read an array of 8x3 reflectance sensors.
Dependencies: DigitalInOut2
Dependents: line_sensors_to_serial_24 R5
Fork of LineSensors by
LineSensors.h@2:885db45ce36a, 2014-10-17 (annotated)
- Committer:
- Hypna
- Date:
- Fri Oct 17 17:52:48 2014 +0000
- Revision:
- 2:885db45ce36a
- Parent:
- 0:acd430185ac0
ready to test
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jmar11 | 0:acd430185ac0 | 1 | #include "mbed.h" |
jmar11 | 0:acd430185ac0 | 2 | #include "DigitalInOut2.h" |
jmar11 | 0:acd430185ac0 | 3 | |
jmar11 | 0:acd430185ac0 | 4 | #ifndef LINESENSORS_H |
jmar11 | 0:acd430185ac0 | 5 | #define LINESENSORS_H |
jmar11 | 0:acd430185ac0 | 6 | |
jmar11 | 0:acd430185ac0 | 7 | class LineSensors{ |
jmar11 | 0:acd430185ac0 | 8 | protected: |
jmar11 | 0:acd430185ac0 | 9 | PinName sensors[8][3]; |
jmar11 | 0:acd430185ac0 | 10 | int sensVal[8][3]; |
jmar11 | 0:acd430185ac0 | 11 | int thresh[8][3]; |
jmar11 | 0:acd430185ac0 | 12 | Timer timer; |
jmar11 | 0:acd430185ac0 | 13 | uint32_t timeOut; |
jmar11 | 0:acd430185ac0 | 14 | |
jmar11 | 0:acd430185ac0 | 15 | public: |
jmar11 | 0:acd430185ac0 | 16 | LineSensors(PinName, PinName, PinName, PinName, PinName, PinName, PinName, PinName, |
jmar11 | 0:acd430185ac0 | 17 | PinName, PinName, PinName, PinName, PinName, PinName, PinName, PinName, |
jmar11 | 0:acd430185ac0 | 18 | PinName, PinName, PinName, PinName, PinName, PinName, PinName, PinName); |
jmar11 | 0:acd430185ac0 | 19 | void setThreshold(); |
jmar11 | 0:acd430185ac0 | 20 | void read(); |
jmar11 | 0:acd430185ac0 | 21 | void lineDetect(bool[8][3]); |
jmar11 | 0:acd430185ac0 | 22 | }; |
jmar11 | 0:acd430185ac0 | 23 | |
jmar11 | 0:acd430185ac0 | 24 | #endif |