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 Adafruit_GFX
Diff: TRSensors.h
- Revision:
- 95:250afd53b710
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TRSensors.h Sat Jun 08 12:00:38 2019 +0000 @@ -0,0 +1,32 @@ +#ifndef TRSensors_h +#define TRSensors_h + +#include "mbed.h" +#include <cstdlib> + +#define QTR_EMITTERS_OFF 0 +#define QTR_EMITTERS_ON 1 +#define QTR_EMITTERS_ON_AND_OFF 2 + +#define QTR_NO_EMITTER_PIN 255 + +#define QTR_MAX_SENSORS 16 + +class TRSensors{ + private: + unsigned char _numSensors; + + public: + TRSensors(PinName p1, PinName p2, PinName p3, PinName p4); + ~TRSensors(); + void AnalogRead(uint16_t *sensor_value); + void calibrate(); + void readCalibrated(uint16_t *sensor_values); + uint16_t readLine(uint16_t *sensor_values, unsigned char white_line = 0); + SPI spi; + DigitalOut cs; + uint16_t *calibratedMin; + uint16_t *calibratedMax; +}; + +#endif