ss

Dependencies:   WS2812 PixelArray Adafruit_GFX

Committer:
eunsong
Date:
Sat Jun 15 13:48:45 2019 +0000
Revision:
3:700a0cf6beea
Parent:
0:27e31cadeb36
a

Who changed what in which revision?

UserRevisionLine numberNew contents of line
eunsong 0:27e31cadeb36 1 #ifndef TRSensors_h
eunsong 0:27e31cadeb36 2 #define TRSensors_h
eunsong 0:27e31cadeb36 3
eunsong 0:27e31cadeb36 4 #include "mbed.h"
eunsong 0:27e31cadeb36 5 #define NUMSENSORS 5
eunsong 0:27e31cadeb36 6
eunsong 0:27e31cadeb36 7 class TRSensors
eunsong 0:27e31cadeb36 8 {
eunsong 0:27e31cadeb36 9 public:
eunsong 0:27e31cadeb36 10
eunsong 0:27e31cadeb36 11 TRSensors(PinName MOSI,PinName MISO, PinName CLK, PinName CS);
eunsong 0:27e31cadeb36 12
eunsong 0:27e31cadeb36 13 void calibrate_init(int *calibratedMin, int *calibratedMax);
eunsong 0:27e31cadeb36 14
eunsong 0:27e31cadeb36 15 void calibrate(int *sensor_values, int *calibratedMin, int *calibratedMax);
eunsong 0:27e31cadeb36 16
eunsong 0:27e31cadeb36 17 void AnalogRead(int *sensor_values);
eunsong 0:27e31cadeb36 18
eunsong 0:27e31cadeb36 19 void readCalibrated(int *sensor_values, int *calibratedMin, int *calibratedMax);
eunsong 0:27e31cadeb36 20
eunsong 0:27e31cadeb36 21 int readLine(int *sensor_values , int *calibratedMin, int *calibratedMax, int *online, char white_line = 0);
eunsong 0:27e31cadeb36 22
eunsong 0:27e31cadeb36 23 int sqrt(int m, int k);
eunsong 0:27e31cadeb36 24
eunsong 0:27e31cadeb36 25 char _numSensors;
eunsong 0:27e31cadeb36 26 int max_sensor_values[NUMSENSORS];
eunsong 0:27e31cadeb36 27 int min_sensor_values[NUMSENSORS];
eunsong 0:27e31cadeb36 28
eunsong 0:27e31cadeb36 29 private:
eunsong 0:27e31cadeb36 30 SPI _spi;
eunsong 0:27e31cadeb36 31 DigitalOut _spi_cs;
eunsong 0:27e31cadeb36 32
eunsong 0:27e31cadeb36 33 };
eunsong 0:27e31cadeb36 34
eunsong 0:27e31cadeb36 35 #endif