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

Committer:
phonemacro
Date:
Thu Apr 11 21:50:18 2019 +0000
Revision:
18:0e25544cb810
Parent:
17:7de7da8c21c3
Updated to blink the LED various colors during shutdown. Corrected the 12 bit conversion wait time.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
phonemacro 0:252077cb2ac5 1 /*******************************************************************************
phonemacro 0:252077cb2ac5 2 * Copyright (C) 2019 Maxim Integrated Products, Inc., All Rights Reserved.
phonemacro 0:252077cb2ac5 3 *
phonemacro 0:252077cb2ac5 4 * Permission is hereby granted, free of charge, to any person obtaining a
phonemacro 0:252077cb2ac5 5 * copy of this software and associated documentation files (the "Software"),
phonemacro 0:252077cb2ac5 6 * to deal in the Software without restriction, including without limitation
phonemacro 0:252077cb2ac5 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
phonemacro 0:252077cb2ac5 8 * and/or sell copies of the Software, and to permit persons to whom the
phonemacro 0:252077cb2ac5 9 * Software is furnished to do so, subject to the following conditions:
phonemacro 0:252077cb2ac5 10 *
phonemacro 0:252077cb2ac5 11 * The above copyright notice and this permission notice shall be included
phonemacro 0:252077cb2ac5 12 * in all copies or substantial portions of the Software.
phonemacro 0:252077cb2ac5 13 *
phonemacro 0:252077cb2ac5 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
phonemacro 0:252077cb2ac5 15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
phonemacro 0:252077cb2ac5 16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
phonemacro 0:252077cb2ac5 17 * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
phonemacro 0:252077cb2ac5 18 * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
phonemacro 0:252077cb2ac5 19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
phonemacro 0:252077cb2ac5 20 * OTHER DEALINGS IN THE SOFTWARE.
phonemacro 0:252077cb2ac5 21 *
phonemacro 0:252077cb2ac5 22 * Except as contained in this notice, the name of Maxim Integrated
phonemacro 0:252077cb2ac5 23 * Products, Inc. shall not be used except as stated in the Maxim Integrated
phonemacro 0:252077cb2ac5 24 * Products, Inc. Branding Policy.
phonemacro 0:252077cb2ac5 25 *
phonemacro 0:252077cb2ac5 26 * The mere transfer of this software does not imply any licenses
phonemacro 0:252077cb2ac5 27 * of trade secrets, proprietary technology, copyrights, patents,
phonemacro 0:252077cb2ac5 28 * trademarks, maskwork rights, or any other form of intellectual
phonemacro 0:252077cb2ac5 29 * property whatsoever. Maxim Integrated Products, Inc. retains all
phonemacro 0:252077cb2ac5 30 * ownership rights.
phonemacro 0:252077cb2ac5 31 *******************************************************************************
phonemacro 0:252077cb2ac5 32 */
phonemacro 0:252077cb2ac5 33 #include "mbed.h"
phonemacro 0:252077cb2ac5 34 #include "max32630fthr.h"
phonemacro 1:72ad3ee71812 35 #include "ds1775.h"
phonemacro 1:72ad3ee71812 36 #include "ds1775_cpp.h"
phonemacro 0:252077cb2ac5 37 #include "USBSerial.h"
phonemacro 18:0e25544cb810 38
phonemacro 0:252077cb2ac5 39 MAX32630FTHR pegasus(MAX32630FTHR::VIO_3V3);
phonemacro 0:252077cb2ac5 40
phonemacro 0:252077cb2ac5 41 DigitalOut rLED(LED1);
phonemacro 0:252077cb2ac5 42 DigitalOut gLED(LED2);
phonemacro 0:252077cb2ac5 43 DigitalOut bLED(LED3);
phonemacro 0:252077cb2ac5 44
phonemacro 0:252077cb2ac5 45 I2C i2cBus(P3_4, P3_5);
phonemacro 0:252077cb2ac5 46
phonemacro 18:0e25544cb810 47 Serial pc(USBTX, USBRX); /* Use USB debug probe for serial link */
phonemacro 18:0e25544cb810 48 Serial uart(P2_1, P2_0);
phonemacro 18:0e25544cb810 49 uint32_t blink_cnt; /* counter for blinking the colors */
phonemacro 18:0e25544cb810 50 void wait_blink_colors(uint8_t dly) {
phonemacro 18:0e25544cb810 51 uint32_t i;
phonemacro 18:0e25544cb810 52 for (i = 0; i < dly; i++) {
phonemacro 18:0e25544cb810 53 wait(.5);
phonemacro 18:0e25544cb810 54 if (blink_cnt & 1)
phonemacro 18:0e25544cb810 55 gLED = !gLED;
phonemacro 18:0e25544cb810 56 if (blink_cnt & 2)
phonemacro 18:0e25544cb810 57 bLED = !bLED;
phonemacro 18:0e25544cb810 58 if (blink_cnt & 4)
phonemacro 18:0e25544cb810 59 rLED = !rLED;
phonemacro 18:0e25544cb810 60 blink_cnt++;
phonemacro 18:0e25544cb810 61 wait(.5);
phonemacro 18:0e25544cb810 62 }
phonemacro 18:0e25544cb810 63 }
phonemacro 18:0e25544cb810 64
phonemacro 18:0e25544cb810 65 void wait_sec_prompt(uint8_t time)
phonemacro 18:0e25544cb810 66 {
phonemacro 18:0e25544cb810 67 // Ports and serial connections
phonemacro 18:0e25544cb810 68 uint32_t i;
phonemacro 18:0e25544cb810 69 for (i = 0; i < time; i++) {
phonemacro 18:0e25544cb810 70 pc.printf(".");
phonemacro 18:0e25544cb810 71 wait_blink_colors(1);
phonemacro 18:0e25544cb810 72 }
phonemacro 18:0e25544cb810 73 pc.printf("\r\n");
phonemacro 18:0e25544cb810 74 }
phonemacro 18:0e25544cb810 75
phonemacro 18:0e25544cb810 76
phonemacro 0:252077cb2ac5 77 // main() runs in its own thread in the OS
phonemacro 0:252077cb2ac5 78 // (note the calls to Thread::wait below for delays)
phonemacro 0:252077cb2ac5 79 /**
phonemacro 1:72ad3ee71812 80 * @brief Sample main program for DS1775
phonemacro 18:0e25544cb810 81 * @version 1.0000.0003
phonemacro 0:252077cb2ac5 82 *
phonemacro 1:72ad3ee71812 83 * @details Sample main program for DS1775
phonemacro 0:252077cb2ac5 84 * The prints are sent to the terminal window (9600, 8n1).
phonemacro 1:72ad3ee71812 85 * The program sets the GPIOs to 3.3V and the program
phonemacro 0:252077cb2ac5 86 * configures the chip and reads temperatures.
phonemacro 0:252077cb2ac5 87 * To run the program, drag and drop the .bin file into the
phonemacro 0:252077cb2ac5 88 * DAPLINK folder. After it finishes flashing, cycle the power or
phonemacro 0:252077cb2ac5 89 * reset the Pegasus (MAX32630FTHR) after flashing by pressing the button on
phonemacro 0:252077cb2ac5 90 * the Pegasus next to the battery connector or the button
phonemacro 0:252077cb2ac5 91 * on the MAXREFDES100HDK.
phonemacro 0:252077cb2ac5 92 */
phonemacro 0:252077cb2ac5 93 int main()
phonemacro 0:252077cb2ac5 94 {
phonemacro 0:252077cb2ac5 95 uint32_t i;
phonemacro 0:252077cb2ac5 96 float temperature;
phonemacro 2:aa39032bf778 97 uint8_t cfg;
phonemacro 18:0e25544cb810 98 uint8_t delay = 30; /* shutdown wait time */
phonemacro 0:252077cb2ac5 99 DigitalOut rLED(LED1, LED_OFF);
phonemacro 0:252077cb2ac5 100 DigitalOut gLED(LED2, LED_OFF);
phonemacro 0:252077cb2ac5 101 DigitalOut bLED(LED3, LED_OFF);
phonemacro 0:252077cb2ac5 102 gLED = LED_ON;
phonemacro 18:0e25544cb810 103 pc.baud(9600); // Baud rate = 115200
phonemacro 18:0e25544cb810 104 pc.printf("DS1775 DS75 Digital Thermometer and "
phonemacro 5:af38bfffd6d3 105 "Thermostat example source code.\r\n");
phonemacro 18:0e25544cb810 106 pc.printf("\r\n");
phonemacro 0:252077cb2ac5 107
phonemacro 1:72ad3ee71812 108 DS1775 temp_sensor(i2cBus, DS1775_I2C_SLAVE_ADR_R0);
phonemacro 0:252077cb2ac5 109 i2cBus.frequency(400000);
phonemacro 2:aa39032bf778 110 /* Configure for 9 bit resolution, fault filter 1,
phonemacro 2:aa39032bf778 111 active low, comparator, continuous,
phonemacro 0:252077cb2ac5 112 */
phonemacro 11:505d7cf8587a 113 temp_sensor.write_cfg_reg(uint8_t(DS1775_CFG_RESOLUTION_9BIT |
phonemacro 2:aa39032bf778 114 DS1775_CFG_FAULT_FILTER_6 | DS1775_CFG_OS_POLARITY_ACT_LOW |
phonemacro 2:aa39032bf778 115 DS1775_CFG_COMPARATOR_MODE | DS1775_CFG_CONTINUOUS));
phonemacro 0:252077cb2ac5 116 for (i = 0; i < 10; i++) {
phonemacro 1:72ad3ee71812 117 wait(DS1775_WAIT_CONV_TIME_9BIT);
phonemacro 5:af38bfffd6d3 118 temperature =
phonemacro 5:af38bfffd6d3 119 temp_sensor.read_reg_as_temperature(DS1775_REG_TEMPERATURE);
phonemacro 18:0e25544cb810 120 pc.printf("Temperature = %3.4f Celsius, %3.4f Fahrenheit\r\n",
phonemacro 0:252077cb2ac5 121 temperature, temp_sensor.celsius_to_fahrenheit(temperature));
phonemacro 0:252077cb2ac5 122 }
phonemacro 2:aa39032bf778 123 temp_sensor.read_cfg_reg(&cfg);
phonemacro 18:0e25544cb810 124 pc.printf("Configuration Register = 0x%02Xh \r\n", cfg);
phonemacro 2:aa39032bf778 125
phonemacro 9:a22549dfaf5f 126 #if 0
phonemacro 14:8ca56fd6b35e 127 temp_sensor.write_trip_low_thyst(-63.9375);
phonemacro 5:af38bfffd6d3 128 temperature =
phonemacro 5:af38bfffd6d3 129 temp_sensor.read_reg_as_temperature(DS1775_REG_THYST_LOW_TRIP);
phonemacro 18:0e25544cb810 130 pc.printf("Thyst Temperature = %3.4f Celsius, %3.4f Fahrenheit\r\n",
phonemacro 0:252077cb2ac5 131 temperature, temp_sensor.celsius_to_fahrenheit(temperature));
phonemacro 0:252077cb2ac5 132
phonemacro 14:8ca56fd6b35e 133 temp_sensor.write_trip_high_tos(64.0625f);
phonemacro 1:72ad3ee71812 134 temperature = temp_sensor.read_reg_as_temperature(DS1775_REG_TOS_HIGH_TRIP);
phonemacro 18:0e25544cb810 135 pc.printf("TOS Temperature = %3.4f Celsius, %3.4f Fahrenheit\r\n",
phonemacro 0:252077cb2ac5 136 temperature, temp_sensor.celsius_to_fahrenheit(temperature));
phonemacro 18:0e25544cb810 137 pc.printf("\r\n\r\n");
phonemacro 0:252077cb2ac5 138 #endif
phonemacro 0:252077cb2ac5 139
phonemacro 18:0e25544cb810 140 pc.printf("\r\n");
phonemacro 0:252077cb2ac5 141
phonemacro 2:aa39032bf778 142 for (i = 0; i < 8; i++) {
phonemacro 17:7de7da8c21c3 143 temp_sensor.write_cfg_reg(uint8_t(DS1775_CFG_RESOLUTION_12BIT |
phonemacro 17:7de7da8c21c3 144 DS1775_CFG_FAULT_FILTER_6 | DS1775_CFG_OS_POLARITY_ACT_LOW |
phonemacro 17:7de7da8c21c3 145 DS1775_CFG_INTERRUPT_MODE | DS1775_CFG_SHUTDOWN));
phonemacro 18:0e25544cb810 146 wait_sec_prompt(delay); /* leave it in shutdown mode for a while */
phonemacro 16:1ebf8a6248be 147 /* Configure for 12 bit resolution, fault filter 6,
phonemacro 2:aa39032bf778 148 active low, interrupt, continous,
phonemacro 2:aa39032bf778 149 */
phonemacro 11:505d7cf8587a 150 temp_sensor.write_cfg_reg(uint8_t(DS1775_CFG_RESOLUTION_12BIT |
phonemacro 2:aa39032bf778 151 DS1775_CFG_FAULT_FILTER_6 | DS1775_CFG_OS_POLARITY_ACT_LOW |
phonemacro 2:aa39032bf778 152 DS1775_CFG_INTERRUPT_MODE | DS1775_CFG_CONTINUOUS));
phonemacro 18:0e25544cb810 153 wait(DS1775_WAIT_CONV_TIME_12BIT);
phonemacro 5:af38bfffd6d3 154 temperature =
phonemacro 5:af38bfffd6d3 155 temp_sensor.read_reg_as_temperature(DS1775_REG_TEMPERATURE);
phonemacro 18:0e25544cb810 156 pc.printf("Temperature = %3.4f Celsius, %3.4f Fahrenheit\r\n",
phonemacro 0:252077cb2ac5 157 temperature, temp_sensor.celsius_to_fahrenheit(temperature));
phonemacro 0:252077cb2ac5 158 }
phonemacro 17:7de7da8c21c3 159 temp_sensor.write_cfg_reg(uint8_t(DS1775_CFG_RESOLUTION_12BIT |
phonemacro 17:7de7da8c21c3 160 DS1775_CFG_FAULT_FILTER_6 | DS1775_CFG_OS_POLARITY_ACT_LOW |
phonemacro 17:7de7da8c21c3 161 DS1775_CFG_INTERRUPT_MODE | DS1775_CFG_SHUTDOWN));
phonemacro 2:aa39032bf778 162 temp_sensor.read_cfg_reg(&cfg);
phonemacro 18:0e25544cb810 163 pc.printf("Configuration Register = 0x%02Xh \r\n", cfg);
phonemacro 0:252077cb2ac5 164
phonemacro 18:0e25544cb810 165 pc.printf("\r\n\r\n");
phonemacro 0:252077cb2ac5 166
phonemacro 9:a22549dfaf5f 167 #if 0
phonemacro 14:8ca56fd6b35e 168 temp_sensor.write_trip_low_thyst(-55.0f);
phonemacro 5:af38bfffd6d3 169 temperature =
phonemacro 5:af38bfffd6d3 170 temp_sensor.read_reg_as_temperature(DS1775_REG_THYST_LOW_TRIP);
phonemacro 18:0e25544cb810 171 pc.printf("Thyst Temperature = %3.4f Celsius, %3.4f Fahrenheit\r\n",
phonemacro 0:252077cb2ac5 172 temperature, temp_sensor.celsius_to_fahrenheit(temperature));
phonemacro 0:252077cb2ac5 173
phonemacro 14:8ca56fd6b35e 174 temp_sensor.write_trip_high_tos(125.0f);
phonemacro 1:72ad3ee71812 175 temperature = temp_sensor.read_reg_as_temperature(DS1775_REG_TOS_HIGH_TRIP);
phonemacro 18:0e25544cb810 176 pc.printf("TOS Temperature = %3.4f Celsius, %3.4f Fahrenheit\r\n",
phonemacro 0:252077cb2ac5 177 temperature, temp_sensor.celsius_to_fahrenheit(temperature));
phonemacro 18:0e25544cb810 178 pc.printf("\r\n\r\n");
phonemacro 0:252077cb2ac5 179 #endif
phonemacro 5:af38bfffd6d3 180
phonemacro 0:252077cb2ac5 181 /***************************************************************************
phonemacro 0:252077cb2ac5 182 * Call the C code version of the driver
phonemacro 0:252077cb2ac5 183 ***************************************************************************
phonemacro 0:252077cb2ac5 184 */
phonemacro 1:72ad3ee71812 185 #include "ds1775_c.h"
phonemacro 18:0e25544cb810 186 pc.printf("C implementation of the code\r\n");
phonemacro 1:72ad3ee71812 187 ds1775_init(DS1775_I2C_SLAVE_ADR_R0);
phonemacro 4:d3171636a86b 188 /* Configure for 9 bit resolution, fault filter 1,
phonemacro 4:d3171636a86b 189 active low, comparator, continuous,
phonemacro 0:252077cb2ac5 190 */
phonemacro 4:d3171636a86b 191 ds1775_write_cfg_reg(uint8_t(DS1775_CFG_RESOLUTION_9BIT |
phonemacro 4:d3171636a86b 192 DS1775_CFG_FAULT_FILTER_6 | DS1775_CFG_OS_POLARITY_ACT_LOW |
phonemacro 4:d3171636a86b 193 DS1775_CFG_COMPARATOR_MODE | DS1775_CFG_CONTINUOUS), i2cBus);
phonemacro 0:252077cb2ac5 194 for (i = 0; i < 10; i++) {
phonemacro 4:d3171636a86b 195 wait(DS1775_WAIT_CONV_TIME_9BIT);
phonemacro 1:72ad3ee71812 196 temperature = ds1775_read_reg_as_temperature(DS1775_REG_TEMPERATURE,
phonemacro 0:252077cb2ac5 197 i2cBus);
phonemacro 18:0e25544cb810 198 pc.printf("Temperature = %3.4f Celsius, %3.4f Fahrenheit\r\n",
phonemacro 0:252077cb2ac5 199 temperature, temp_sensor.celsius_to_fahrenheit(temperature));
phonemacro 0:252077cb2ac5 200 }
phonemacro 4:d3171636a86b 201
phonemacro 4:d3171636a86b 202 ds1775_read_cfg_reg(&cfg, i2cBus);
phonemacro 18:0e25544cb810 203 pc.printf("Configuration Register = 0x%02Xh \r\n", cfg);
phonemacro 0:252077cb2ac5 204
phonemacro 9:a22549dfaf5f 205 #if 0
phonemacro 14:8ca56fd6b35e 206 ds1775_write_trip_low_thyst(-63.9375, i2cBus);
phonemacro 5:af38bfffd6d3 207 temperature = ds1775_read_reg_as_temperature(DS1775_REG_THYST_LOW_TRIP,
phonemacro 5:af38bfffd6d3 208 i2cBus);
phonemacro 18:0e25544cb810 209 pc.printf("Thyst Temperature = %3.4f Celsius, %3.4f Fahrenheit\r\n",
phonemacro 1:72ad3ee71812 210 temperature, ds1775_celsius_to_fahrenheit(temperature));
phonemacro 0:252077cb2ac5 211
phonemacro 14:8ca56fd6b35e 212 ds1775_write_trip_high_tos(64.0625f, i2cBus);
phonemacro 5:af38bfffd6d3 213 temperature = ds1775_read_reg_as_temperature(DS1775_REG_TOS_HIGH_TRIP,
phonemacro 5:af38bfffd6d3 214 i2cBus);
phonemacro 18:0e25544cb810 215 pc.printf("TOS Temperature = %3.4f Celsius, %3.4f Fahrenheit\r\n",
phonemacro 1:72ad3ee71812 216 temperature, ds1775_celsius_to_fahrenheit(temperature));
phonemacro 0:252077cb2ac5 217 #endif
phonemacro 0:252077cb2ac5 218
phonemacro 18:0e25544cb810 219 pc.printf("\r\n");
phonemacro 5:af38bfffd6d3 220 for (i = 0; i < 8; i++) {
phonemacro 17:7de7da8c21c3 221 ds1775_write_cfg_reg(uint8_t(DS1775_CFG_RESOLUTION_12BIT |
phonemacro 17:7de7da8c21c3 222 DS1775_CFG_FAULT_FILTER_6 | DS1775_CFG_OS_POLARITY_ACT_LOW |
phonemacro 17:7de7da8c21c3 223 DS1775_CFG_INTERRUPT_MODE | DS1775_CFG_SHUTDOWN), i2cBus);
phonemacro 18:0e25544cb810 224 wait_sec_prompt(delay); /* leave it in shutdown mode for a while */
phonemacro 16:1ebf8a6248be 225 /* Configure for 12 bit resolution, fault filter 6,
phonemacro 5:af38bfffd6d3 226 active low, interrupt, continous,
phonemacro 5:af38bfffd6d3 227 */
phonemacro 5:af38bfffd6d3 228 ds1775_write_cfg_reg(uint8_t(DS1775_CFG_RESOLUTION_12BIT |
phonemacro 5:af38bfffd6d3 229 DS1775_CFG_FAULT_FILTER_6 | DS1775_CFG_OS_POLARITY_ACT_LOW |
phonemacro 5:af38bfffd6d3 230 DS1775_CFG_INTERRUPT_MODE | DS1775_CFG_CONTINUOUS),
phonemacro 0:252077cb2ac5 231 i2cBus);
phonemacro 18:0e25544cb810 232 wait(DS1775_WAIT_CONV_TIME_12BIT);
phonemacro 1:72ad3ee71812 233 temperature = ds1775_read_reg_as_temperature(DS1775_REG_TEMPERATURE,
phonemacro 0:252077cb2ac5 234 i2cBus);
phonemacro 18:0e25544cb810 235 pc.printf("Temperature = %3.4f Celsius, %3.4f Fahrenheit\r\n",
phonemacro 0:252077cb2ac5 236 temperature, temp_sensor.celsius_to_fahrenheit(temperature));
phonemacro 0:252077cb2ac5 237 }
phonemacro 17:7de7da8c21c3 238 ds1775_write_cfg_reg(uint8_t(DS1775_CFG_RESOLUTION_12BIT |
phonemacro 17:7de7da8c21c3 239 DS1775_CFG_FAULT_FILTER_6 | DS1775_CFG_OS_POLARITY_ACT_LOW |
phonemacro 17:7de7da8c21c3 240 DS1775_CFG_INTERRUPT_MODE | DS1775_CFG_SHUTDOWN), i2cBus);
phonemacro 5:af38bfffd6d3 241 ds1775_read_cfg_reg(&cfg, i2cBus);
phonemacro 18:0e25544cb810 242 pc.printf("Configuration Register = 0x%02Xh \r\n", cfg);
phonemacro 0:252077cb2ac5 243
phonemacro 9:a22549dfaf5f 244 #if 0
phonemacro 14:8ca56fd6b35e 245 ds1775_write_trip_low_thyst(-55, i2cBus);
phonemacro 5:af38bfffd6d3 246 temperature = ds1775_read_reg_as_temperature(DS1775_REG_THYST_LOW_TRIP,
phonemacro 5:af38bfffd6d3 247 i2cBus);
phonemacro 18:0e25544cb810 248 pc.printf("Thyst Temperature = %3.4f Celsius, %3.4f Fahrenheit\r\n",
phonemacro 1:72ad3ee71812 249 temperature, ds1775_celsius_to_fahrenheit(temperature));
phonemacro 0:252077cb2ac5 250
phonemacro 14:8ca56fd6b35e 251 ds1775_write_trip_high_tos(125.0f, i2cBus);
phonemacro 5:af38bfffd6d3 252 temperature = ds1775_read_reg_as_temperature(DS1775_REG_TOS_HIGH_TRIP,
phonemacro 5:af38bfffd6d3 253 i2cBus);
phonemacro 18:0e25544cb810 254 pc.printf("TOS Temperature = %3.4f Celsius, %3.4f Fahrenheit\r\n",
phonemacro 1:72ad3ee71812 255 temperature, ds1775_celsius_to_fahrenheit(temperature));
phonemacro 0:252077cb2ac5 256 #endif
phonemacro 18:0e25544cb810 257 pc.printf("\r\n\r\n\r\n");
phonemacro 0:252077cb2ac5 258
phonemacro 0:252077cb2ac5 259
phonemacro 0:252077cb2ac5 260 while (true) { // Blink the green LED
phonemacro 0:252077cb2ac5 261 gLED = !gLED;
phonemacro 0:252077cb2ac5 262 wait(0.5);
phonemacro 0:252077cb2ac5 263 }
phonemacro 0:252077cb2ac5 264 }
phonemacro 0:252077cb2ac5 265
phonemacro 0:252077cb2ac5 266