Josselin CATRO
/
S3_DS1621
Projet S4 tut
Revision 0:9b9f1a62ee88, committed 2021-01-19
- Comitter:
- __joss__
- Date:
- Tue Jan 19 08:44:37 2021 +0000
- Commit message:
- Projet S4 tut DS1621 (Josselin)
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/DS1621.lib Tue Jan 19 08:44:37 2021 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/dupuyb/code/DS1621/#d6310fd6df8e
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Jan 19 08:44:37 2021 +0000 @@ -0,0 +1,24 @@ +#include "mbed.h" +#include "ds1621.h" + +#define DS1621_ADDR 0 + +Serial pc(USBTX, USBRX); +I2C i2c(p28, p27); +DS1621 ds(&i2c, DS1621_ADDR); + + +DigitalOut myled(LED1); + +int main(){ + i2c.frequency(5000); //5khz + pc.printf("-----------------------\n\rMain\n\r"); + int xsec=4; + float temp = 0.0; + ds.init(DS1621_ADDR); + while (1) { + temp = ds.read(DS1621_ADDR); + pc.printf("Measurment at start + %d seconds, Temperature=%3.1f\n\r",xsec,temp); + wait(xsec); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Jan 19 08:44:37 2021 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file