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.
Dependencies: LM75B SB1602E mbed
main.cpp
00001 #include "mbed.h" 00002 #include "LM75B.h" 00003 #include "SB1602E.h" 00004 00005 //Create an LM75B object at the default address (ADDRESS_0) 00006 LM75B sensor(dp5, dp27); 00007 SB1602E lcd( dp5, dp27); 00008 00009 int main() 00010 { 00011 //Try to open the LM75B 00012 if (sensor.open()) { 00013 printf("Device detected!\n"); 00014 00015 while (1) { 00016 lcd.clear(); 00017 //Print the current temperature 00018 lcd.printf(0,"Tmp:%.1f\n", (float)sensor); 00019 00020 //Sleep for 0.5 seconds 00021 wait(0.5); 00022 } 00023 } else { 00024 error("Device not detected!\n"); 00025 } 00026 }
Generated on Tue Jul 26 2022 17:47:01 by
1.7.2