arduino2/Test_I2C_ds1631/Test_I2C_ds1631.ino
2020-11-06 13:17:55 +01:00

24 lines
497 B
C++

#include <Wire.h> // Only needed for Arduino 1.6.5 and earlier
#include <DS1631.h>
DS1631 Temp1(0); // ini
void setup() {
Wire.begin(); // start up I2C bus
delay(500);
// scan();
Serial.begin(115200);
Serial.println("Hi there");
int config = Temp1.readConfig();
Temp1.writeConfig(13); // Set to 12-bit, 1-shot mode
config = Temp1.readConfig();
}
void loop() {
float tist = Temp1.readTempOneShot();
Serial.print("Temp: ");
Serial.println(tist);
delay(1000);
}