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.
Dependents: Grove_Temp_Hello_world
Grove_temp_sensor.h@3:2b40039c6e54, 2016-03-10 (annotated)
- Committer:
- peipei123
- Date:
- Thu Mar 10 19:28:33 2016 +0000
- Revision:
- 3:2b40039c6e54
- Parent:
- 2:cf68822a48d0
- Child:
- 6:2d65df11758a
1;
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| peipei123 | 0:d47df95f4936 | 1 | #include "mbed.h" |
| peipei123 | 0:d47df95f4936 | 2 | |
| peipei123 | 2:cf68822a48d0 | 3 | |
| peipei123 | 2:cf68822a48d0 | 4 | /** Setup a new class for Grove_temp_sensor sensor |
| peipei123 | 2:cf68822a48d0 | 5 | * |
| peipei123 | 2:cf68822a48d0 | 6 | * |
| peipei123 | 2:cf68822a48d0 | 7 | * |
| peipei123 | 2:cf68822a48d0 | 8 | * @endcode |
| peipei123 | 2:cf68822a48d0 | 9 | */ |
| peipei123 | 1:813f0d53a75c | 10 | class Grove_temp_sensor |
| peipei123 | 1:813f0d53a75c | 11 | { |
| peipei123 | 0:d47df95f4936 | 12 | public: |
| peipei123 | 1:813f0d53a75c | 13 | /** Create a Grove_temp_sensor object connected to the pin |
| peipei123 | 0:d47df95f4936 | 14 | * |
| peipei123 | 1:813f0d53a75c | 15 | * @param pin to connect to |
| peipei123 | 0:d47df95f4936 | 16 | */ |
| peipei123 | 1:813f0d53a75c | 17 | Grove_temp_sensor(PinName pin); |
| peipei123 | 3:2b40039c6e54 | 18 | /** Read the temperature in Fahrenheit |
| peipei123 | 0:d47df95f4936 | 19 | * |
| peipei123 | 1:813f0d53a75c | 20 | * @param returns temperature |
| peipei123 | 0:d47df95f4936 | 21 | */ |
| peipei123 | 3:2b40039c6e54 | 22 | float read_F(); |
| peipei123 | 3:2b40039c6e54 | 23 | /** Read the temperature in Celsius |
| peipei123 | 3:2b40039c6e54 | 24 | * |
| peipei123 | 3:2b40039c6e54 | 25 | * @param returns temperature |
| peipei123 | 3:2b40039c6e54 | 26 | */ |
| peipei123 | 3:2b40039c6e54 | 27 | float read_C(); |
| peipei123 | 1:813f0d53a75c | 28 | private: |
| peipei123 | 1:813f0d53a75c | 29 | //class sets up the AnalogIn pin |
| peipei123 | 1:813f0d53a75c | 30 | AnalogIn _pin; |
| peipei123 | 0:d47df95f4936 | 31 | }; |
| peipei123 | 0:d47df95f4936 | 32 | |
| peipei123 | 1:813f0d53a75c | 33 | |
| peipei123 | 1:813f0d53a75c | 34 | |
| peipei123 | 1:813f0d53a75c | 35 |
Grove Temperature Sensor