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: HARP2 HARP3 Thermostat_NucleoF401 4180Lab4_p1 ... more
TMP36GZ Class Reference
TMP36GZ temperature sensor class. More...
#include <TMP36GZ.h>
Public Member Functions | |
| TMP36GZ (PinName pin) | |
| Constructor for TMP36GZ sensor. | |
| float | sample () |
| Sample the sensor in deg C. | |
| float | sample_f () |
| Sample the sensor in deg F. | |
Detailed Description
TMP36GZ temperature sensor class.
Example:
#include "mbed.h" #include "TMP36GZ.h" TMP36GZ temp_sensor(p20); Serial pc(USBTX, USBRX); // tx, rx int main() { pc.baud(9600); while(1) { pc.printf("Temp: %6.3f deg/C - %6.3f deg/F\n", temp_sensor.sample(), temp_sensor.sample_f()); wait(1.0); // wait 1 second } }
DESCRIPTION
C++ file for TMP36GZ temperature sensor library
/----\ |1 2 3 | --------
1 - Vs, connect 3.3V (Vout) 2 - Vout - connect to input pin 3 - GND - connect to ground
750mV = 25 deg/C
10mV / deg/C
Definition at line 61 of file TMP36GZ.h.
Constructor & Destructor Documentation
| TMP36GZ | ( | PinName | pin ) |
Constructor for TMP36GZ sensor.
Analog input pin from p15-p20
- Parameters:
-
pin the analog input pin (connect to pin 2 on sensor)
Definition at line 22 of file TMP36GZ.cpp.
Member Function Documentation
| float sample | ( | ) |
| float sample_f | ( | ) |
Generated on Fri Jul 15 2022 02:09:54 by
1.7.2