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.
Revision 0:487c492ca69a, committed 2012-06-15
- Comitter:
- hgc_8421
- Date:
- Fri Jun 15 16:03:54 2012 +0000
- Commit message:
- Initial
Changed in this revision
diff -r 000000000000 -r 487c492ca69a DS18B20.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/DS18B20.lib Fri Jun 15 16:03:54 2012 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/kriedel/code/DS18B20/#21c0c97a5d7c
diff -r 000000000000 -r 487c492ca69a main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Jun 15 16:03:54 2012 +0000 @@ -0,0 +1,27 @@ +#include "mbed.h" +#include "DS18B20.h" +#include "OneWireDefs.h" +#define THERMOMETER DS18B20 +DigitalOut myled(LED1); + +int main() { +// device( crcOn, useAddress, parasitic, mbed pin ) + THERMOMETER device(true, true, false, p25); + + while (!device.initialize()); // keep calling until it works + while(1) { + // changing the resolutions only affects the DS18B20. The DS18S20 is fixed. + device.setResolution(nineBit); + device.readTemperature(); + wait(5); + device.setResolution(tenBit); + device.readTemperature(); + wait(5); + device.setResolution(elevenBit); + device.readTemperature(); + wait(5); + device.setResolution(twelveBit); + device.readTemperature(); + wait(5); + } +}
diff -r 000000000000 -r 487c492ca69a mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri Jun 15 16:03:54 2012 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/078e4b97a13e