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: app-board-TempAlarm LM75B IoTWorkshopSensors EduRobot ... more
LM75B Class Reference
#include <LM75B.h>
Public Types | |
| enum | Address { ADDRESS_0 = (0x48 << 1), ADDRESS_1 = (0x49 << 1), ADDRESS_2 = (0x4A << 1), ADDRESS_3 = (0x4B << 1), ADDRESS_4 = (0x4C << 1), ADDRESS_5 = (0x4D << 1), ADDRESS_6 = (0x4E << 1), ADDRESS_7 = (0x4F << 1) } |
Represents the different I2C address possibilities for the LM75B. More... | |
| enum | PowerMode { POWER_NORMAL, POWER_SHUTDOWN } |
Represents the power mode of the LM75B. More... | |
| enum | OSMode { OS_COMPARATOR, OS_INTERRUPT } |
Represents OS pin mode of the LM75B. More... | |
| enum | OSPolarity { OS_ACTIVE_LOW, OS_ACTIVE_HIGH } |
Represents OS pin polarity of the LM75B. More... | |
| enum | OSFaultQueue { OS_FAULT_QUEUE_1, OS_FAULT_QUEUE_2, OS_FAULT_QUEUE_4, OS_FAULT_QUEUE_6 } |
Represents OS pin fault queue length of the LM75B. More... | |
Public Member Functions | |
| LM75B (PinName sda, PinName scl, Address addr=ADDRESS_0, int hz=400000) | |
| Create an LM75B object connected to the specified I2C pins with the specified I2C slave address. | |
| bool | open () |
| Probe for the LM75B and indicate if it's present on the bus. | |
| LM75B::PowerMode | powerMode () |
| Get the current power mode of the LM75B. | |
| void | powerMode (PowerMode mode) |
| Set the power mode of the LM75B. | |
| LM75B::OSMode | osMode () |
| Get the current OS pin mode of the LM75B. | |
| void | osMode (OSMode mode) |
| Set the OS pin mode of the LM75B. | |
| LM75B::OSPolarity | osPolarity () |
| Get the current OS pin polarity of the LM75B. | |
| void | osPolarity (OSPolarity polarity) |
| Set the OS pin polarity of the LM75B. | |
| LM75B::OSFaultQueue | osFaultQueue () |
| Get the current OS pin fault queue length of the LM75B. | |
| void | osFaultQueue (OSFaultQueue queue) |
| Set the OS pin fault queue length of the LM75B. | |
| float | alertTemp () |
| Get the current alert temperature threshold of the LM75B. | |
| void | alertTemp (float temp) |
| Set the alert temperature threshold of the LM75B. | |
| float | alertHyst () |
| Get the current alert temperature hysteresis threshold of the LM75B. | |
| void | alertHyst (float temp) |
| Set the alert temperature hysteresis threshold of the LM75B. | |
| float | temp () |
| Get the current temperature measurement of the LM75B. | |
| operator float () | |
| A shorthand for temp() | |
Detailed Description
LM75B class.
Used for controlling an LM75B temperature sensor connected via I2C.
Example:
#include "mbed.h" #include "LM75B.h" //Create an LM75B object at the default address (ADDRESS_0) LM75B sensor(p28, p27); int main() { //Try to open the LM75B if (sensor.open()) { printf("Device detected!\n"); while (1) { //Print the current temperature printf("Temp = %.3f\n", (float)sensor); //Sleep for 0.5 seconds wait(0.5); } } else { error("Device not detected!\n"); } }
Definition at line 52 of file LM75B.h.
Member Enumeration Documentation
| enum Address |
Represents the different I2C address possibilities for the LM75B.
| enum OSFaultQueue |
Represents OS pin fault queue length of the LM75B.
| enum OSMode |
Represents OS pin mode of the LM75B.
- Enumerator:
| enum OSPolarity |
| enum PowerMode |
Constructor & Destructor Documentation
Member Function Documentation
| float alertHyst | ( | ) |
| void alertHyst | ( | float | temp ) |
| void alertTemp | ( | float | temp ) |
| float alertTemp | ( | ) |
| bool open | ( | ) |
| operator float | ( | ) |
| void osFaultQueue | ( | OSFaultQueue | queue ) |
| LM75B::OSFaultQueue osFaultQueue | ( | ) |
| LM75B::OSMode osMode | ( | ) |
| void osMode | ( | OSMode | mode ) |
| LM75B::OSPolarity osPolarity | ( | ) |
| void osPolarity | ( | OSPolarity | polarity ) |
| void powerMode | ( | PowerMode | mode ) |
| LM75B::PowerMode powerMode | ( | ) |
Generated on Tue Jul 12 2022 18:33:55 by
1.7.2
LM75B Temperature Sensor
LPC General Purpose Shield OM13082