schneider françois
/
MAX31820
Max31820
Revision 0:3fb29ad2c89d, committed 2018-04-30
- Comitter:
- schnf30
- Date:
- Mon Apr 30 07:57:06 2018 +0000
- Commit message:
- Max31820
Changed in this revision
diff -r 000000000000 -r 3fb29ad2c89d Sf18B20.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Sf18B20.lib Mon Apr 30 07:57:06 2018 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/schnf30/code/Sf18B20/#3d3ba015f6af
diff -r 000000000000 -r 3fb29ad2c89d main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Apr 30 07:57:06 2018 +0000 @@ -0,0 +1,21 @@ +#include "mbed.h" +#include "DS1820.h" + +Serial serial(USBTX, USBRX); + +int main() +{ + DS1820 ds1820(PA_0); // substitute PA_0 with actual mbed pin name connected to the DS1820 data pin + + if(ds1820.begin()) { + ds1820.setResolution(12); + ds1820.startConversion(); + wait(1.0); + while(1) { + serial.printf("temp = %3.1f\r\n", ds1820.read()); // read temperature + ds1820.startConversion(); // start temperature conversion + wait(1.0); // let DS1820 complete the temperature conversion + } + } else + serial.printf("No DS1820 sensor found!\r\n"); +}
diff -r 000000000000 -r 3fb29ad2c89d mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Apr 30 07:57:06 2018 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/5aab5a7997ee \ No newline at end of file