![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
d
Dependencies: mbed DS1621 4dGENIE
Diff: main.cpp
- Revision:
- 0:c8f90c6586ea
diff -r 000000000000 -r c8f90c6586ea main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Feb 16 14:15:44 2021 +0000 @@ -0,0 +1,21 @@ +#include "mbed.h" +#include "ds1621.h" + +#define DS1621_ADDR 0x90 + +Serial pc(USBTX, USBRX); +I2C i2c_ds(p28, p27); +DS1621 ds(&i2c_ds, DS1621_ADDR); +float temp, Htemp; + +int main() { + ds.StartConversion(1); + //ds.SetConfig(0x01); //1shot + ds.SetConfig(0x00); //polarity + while(1) { + ds.GetTemp(READ_TEMPERATURE, &temp); + pc.printf("%f \n\r", temp); + wait(1.0); + pc.printf("\n\r"); + } +} \ No newline at end of file