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
TRSensors.h
- Committer:
- ParkChunMyong
- Date:
- 2019-06-13
- Revision:
- 96:7465ab270e7a
- Parent:
- 95:250afd53b710
File content as of revision 96:7465ab270e7a:
#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