![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Sample host software for the Maxim Integrated DS1775, DS75 Digital Thermometer Thermostat IC hosted on the MAX32630FTHR. The DS1775 is suitable for PCs, cell phones, and other thermally sensitive systems.
Dependencies: max32630fthr DS1775_Digitial_Thermometer_Thermostat USBDevice
Diff: main.cpp
- Revision:
- 8:2b1ab5937e95
- Parent:
- 5:af38bfffd6d3
- Child:
- 9:a22549dfaf5f
--- a/main.cpp Sun Apr 07 11:31:29 2019 +0000 +++ b/main.cpp Sun Apr 07 11:39:25 2019 +0000 @@ -91,16 +91,14 @@ temp_sensor.read_cfg_reg(&cfg); printf("Configuration Register = 0x%02Xh \r\n", cfg); -#if 0 +#if 1 temp_sensor.write_trip_low(-63.9375); - wait(0.03); temperature = temp_sensor.read_reg_as_temperature(DS1775_REG_THYST_LOW_TRIP); printf("Thyst Temperature = %3.4f Celsius, %3.4f Fahrenheit\r\n", temperature, temp_sensor.celsius_to_fahrenheit(temperature)); temp_sensor.write_trip_high(64.0625f); - wait(0.03); temperature = temp_sensor.read_reg_as_temperature(DS1775_REG_TOS_HIGH_TRIP); printf("TOS Temperature = %3.4f Celsius, %3.4f Fahrenheit\r\n", temperature, temp_sensor.celsius_to_fahrenheit(temperature)); @@ -131,16 +129,14 @@ printf("\r\n\r\n"); -#if 0 +#if 1 temp_sensor.write_trip_low(-55.0f); - wait(0.03); temperature = temp_sensor.read_reg_as_temperature(DS1775_REG_THYST_LOW_TRIP); printf("Thyst Temperature = %3.4f Celsius, %3.4f Fahrenheit\r\n", temperature, temp_sensor.celsius_to_fahrenheit(temperature)); temp_sensor.write_trip_high(125.0f); - wait(0.03); temperature = temp_sensor.read_reg_as_temperature(DS1775_REG_TOS_HIGH_TRIP); printf("TOS Temperature = %3.4f Celsius, %3.4f Fahrenheit\r\n", temperature, temp_sensor.celsius_to_fahrenheit(temperature)); @@ -171,16 +167,14 @@ ds1775_read_cfg_reg(&cfg, i2cBus); printf("Configuration Register = 0x%02Xh \r\n", cfg); -#if 0 +#if 1 ds1775_write_trip_low(-63.9375, i2cBus); - wait(0.03); temperature = ds1775_read_reg_as_temperature(DS1775_REG_THYST_LOW_TRIP, i2cBus); printf("Thyst Temperature = %3.4f Celsius, %3.4f Fahrenheit\r\n", temperature, ds1775_celsius_to_fahrenheit(temperature)); ds1775_write_trip_high(64.0625f, i2cBus); - wait(0.03); temperature = ds1775_read_reg_as_temperature(DS1775_REG_TOS_HIGH_TRIP, i2cBus); printf("TOS Temperature = %3.4f Celsius, %3.4f Fahrenheit\r\n", @@ -209,16 +203,14 @@ ds1775_read_cfg_reg(&cfg, i2cBus); printf("Configuration Register = 0x%02Xh \r\n", cfg); -#if 0 +#if 1 ds1775_write_trip_low(-55, i2cBus); - wait(0.03); temperature = ds1775_read_reg_as_temperature(DS1775_REG_THYST_LOW_TRIP, i2cBus); printf("Thyst Temperature = %3.4f Celsius, %3.4f Fahrenheit\r\n", temperature, ds1775_celsius_to_fahrenheit(temperature)); ds1775_write_trip_high(125.0f, i2cBus); - wait(0.03); temperature = ds1775_read_reg_as_temperature(DS1775_REG_TOS_HIGH_TRIP, i2cBus); printf("TOS Temperature = %3.4f Celsius, %3.4f Fahrenheit\r\n",