Color sensor reset at the end of calibration added. sensor id auto assignment was changed to be a fixed value assignment to avoid sensor id shift when some sensor is absent.
Dependencies: UniGraphic mbed vt100
sensors/SMTC502AT.h@1:8818b793d147, 2018-02-23 (annotated)
- Committer:
- Rhyme
- Date:
- Fri Feb 23 07:51:55 2018 +0000
- Revision:
- 1:8818b793d147
- Parent:
- 0:ce97f6d34336
Wrong behavior when one of color sensor is missing has been fixed.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Rhyme | 0:ce97f6d34336 | 1 | #ifndef _SMTC502AT_H_ |
Rhyme | 0:ce97f6d34336 | 2 | #define _SMTC502AT_H_ |
Rhyme | 0:ce97f6d34336 | 3 | |
Rhyme | 0:ce97f6d34336 | 4 | #include "mbed.h" |
Rhyme | 0:ce97f6d34336 | 5 | |
Rhyme | 0:ce97f6d34336 | 6 | /** |
Rhyme | 0:ce97f6d34336 | 7 | * Semitec 502AT-11 temperature sensor |
Rhyme | 0:ce97f6d34336 | 8 | */ |
Rhyme | 0:ce97f6d34336 | 9 | |
Rhyme | 0:ce97f6d34336 | 10 | class SMTC502AT { |
Rhyme | 0:ce97f6d34336 | 11 | public: |
Rhyme | 0:ce97f6d34336 | 12 | /** |
Rhyme | 0:ce97f6d34336 | 13 | * constructor |
Rhyme | 0:ce97f6d34336 | 14 | * @param *ain AnalogIn object |
Rhyme | 0:ce97f6d34336 | 15 | * @param R0 5.0 ohm (default) |
Rhyme | 0:ce97f6d34336 | 16 | * @param R1 4.95 ohm (default) |
Rhyme | 0:ce97f6d34336 | 17 | * @param B 3324 (default) |
Rhyme | 0:ce97f6d34336 | 18 | * @param T0 298.15 (default) |
Rhyme | 0:ce97f6d34336 | 19 | */ |
Rhyme | 0:ce97f6d34336 | 20 | SMTC502AT(AnalogIn *ain, float R0=5.0, float R1=4.95, float B=3324, float T0=298.15) ; |
Rhyme | 0:ce97f6d34336 | 21 | |
Rhyme | 0:ce97f6d34336 | 22 | /** |
Rhyme | 0:ce97f6d34336 | 23 | * destructor |
Rhyme | 0:ce97f6d34336 | 24 | */ |
Rhyme | 0:ce97f6d34336 | 25 | ~SMTC502AT(void) ; |
Rhyme | 0:ce97f6d34336 | 26 | |
Rhyme | 0:ce97f6d34336 | 27 | /** |
Rhyme | 0:ce97f6d34336 | 28 | * getTemp get temperature |
Rhyme | 0:ce97f6d34336 | 29 | * @returns temperature in float format |
Rhyme | 0:ce97f6d34336 | 30 | */ |
Rhyme | 0:ce97f6d34336 | 31 | float getTemp(void) ; |
Rhyme | 0:ce97f6d34336 | 32 | private: |
Rhyme | 0:ce97f6d34336 | 33 | AnalogIn *_ain ; |
Rhyme | 0:ce97f6d34336 | 34 | float _r0 ; |
Rhyme | 0:ce97f6d34336 | 35 | float _r1 ; |
Rhyme | 0:ce97f6d34336 | 36 | float _b ; |
Rhyme | 0:ce97f6d34336 | 37 | float _t0 ; |
Rhyme | 0:ce97f6d34336 | 38 | } ; |
Rhyme | 0:ce97f6d34336 | 39 | |
Rhyme | 0:ce97f6d34336 | 40 | #endif /* _SMTC502AT_H_ */ |