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: mbed C12832 LM75B
Diff: main.cpp
- Revision:
- 6:bb84f3ab523d
- Parent:
- 5:608f2bf4d3f7
- Child:
- 7:80852d9feb4b
--- a/main.cpp Thu Feb 06 14:05:51 2014 +0000
+++ b/main.cpp Fri Feb 07 17:44:04 2014 +0000
@@ -2,27 +2,16 @@
#include "LM75B.h"
#include "C12832.h"
-C12832 lcd(p5, p7, p6, p8, p11);
-
-LM75B sensor(p28,p27);
-Serial pc(USBTX,USBRX);
+// Using Arduino pin notation
+C12832 lcd(D11, D13, D12, D7, D10);
+LM75B sensor(SDA,SCL);
int main ()
{
-
- //Try to open the LM75B
- if (sensor.open()) {
- printf("Device detected!\n");
-
- while (1) {
- lcd.cls();
- lcd.locate(0,3);
- lcd.printf("Temp = %.3f\n", (float)sensor);
- wait(1.0);
- }
-
- } else {
- error("Device not detected!\n");
+ while (1) {
+ lcd.cls();
+ lcd.locate(0,3);
+ lcd.printf("Temp = %.1f\n", float(sensor));
+ wait(1.0);
}
-
}