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: DS18B20Sensor mbed
Revision 0:765def67b2b6, committed 2014-04-10
- Comitter:
- umairaftab
- Date:
- Thu Apr 10 00:02:15 2014 +0000
- Commit message:
- working;
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/DS18B20Sensor.lib Thu Apr 10 00:02:15 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/jsteve/code/DS18B20Sensor/#9fd95d590149
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Thu Apr 10 00:02:15 2014 +0000
@@ -0,0 +1,25 @@
+#include "mbed.h"
+#include "DS18B20Sensor.h"
+
+// Instantiate sensor with hardware in pin p30
+DS18B20Sensor sensor(PTB4);
+
+// Setup a window to the world
+//Serial pc(p13, p14);
+Serial pc(USBTX, USBRX);
+
+int main()
+{
+ char sensorBuf[25];
+
+ // count will search for sensors, if not already called
+ pc.printf("Found %d sensor/s\r", sensor.count());
+
+ uint8_t result = sensor.startReading(true); // start sensor readings and wait
+
+ for (uint8_t i = 0; i < sensor.count(); i++) {
+ sensor.getReading(sensorBuf, i); // get result into buf
+ pc.printf("Sensor %d : %s\r", i+1, sensorBuf); // display it to the world
+ }
+
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Apr 10 00:02:15 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/7d30d6019079 \ No newline at end of file