Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: max32630fthr DS1775_Digitial_Thermometer_Thermostat USBDevice
main.cpp@0:252077cb2ac5, 2019-04-07 (annotated)
- Committer:
- phonemacro
- Date:
- Sun Apr 07 07:33:09 2019 +0000
- Revision:
- 0:252077cb2ac5
- Child:
- 1:72ad3ee71812
Rough Initial Commit
Who changed what in which revision?
| User | Revision | Line number | New 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 | 0:252077cb2ac5 | 35 | #include "max31875.h" |
| phonemacro | 0:252077cb2ac5 | 36 | #include "max31875_cpp.h" |
| phonemacro | 0:252077cb2ac5 | 37 | #include "USBSerial.h" |
| phonemacro | 0:252077cb2ac5 | 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 | 0:252077cb2ac5 | 47 | // main() runs in its own thread in the OS |
| phonemacro | 0:252077cb2ac5 | 48 | // (note the calls to Thread::wait below for delays) |
| phonemacro | 0:252077cb2ac5 | 49 | /** |
| phonemacro | 0:252077cb2ac5 | 50 | * @brief Sample main program for MAX31875 |
| phonemacro | 0:252077cb2ac5 | 51 | * @version 1.0000.0000 |
| phonemacro | 0:252077cb2ac5 | 52 | * |
| phonemacro | 0:252077cb2ac5 | 53 | * @details Sample main program for MAX31875 |
| phonemacro | 0:252077cb2ac5 | 54 | * The prints are sent to the terminal window (9600, 8n1). |
| phonemacro | 0:252077cb2ac5 | 55 | * The program sets the GPIOs to 1.8V and the program |
| phonemacro | 0:252077cb2ac5 | 56 | * configures the chip and reads temperatures. |
| phonemacro | 0:252077cb2ac5 | 57 | * To run the program, drag and drop the .bin file into the |
| phonemacro | 0:252077cb2ac5 | 58 | * DAPLINK folder. After it finishes flashing, cycle the power or |
| phonemacro | 0:252077cb2ac5 | 59 | * reset the Pegasus (MAX32630FTHR) after flashing by pressing the button on |
| phonemacro | 0:252077cb2ac5 | 60 | * the Pegasus next to the battery connector or the button |
| phonemacro | 0:252077cb2ac5 | 61 | * on the MAXREFDES100HDK. |
| phonemacro | 0:252077cb2ac5 | 62 | */ |
| phonemacro | 0:252077cb2ac5 | 63 | int main() |
| phonemacro | 0:252077cb2ac5 | 64 | { |
| phonemacro | 0:252077cb2ac5 | 65 | uint32_t i; |
| phonemacro | 0:252077cb2ac5 | 66 | float temperature; |
| phonemacro | 0:252077cb2ac5 | 67 | uint16_t cfg; |
| phonemacro | 0:252077cb2ac5 | 68 | DigitalOut rLED(LED1, LED_OFF); |
| phonemacro | 0:252077cb2ac5 | 69 | DigitalOut gLED(LED2, LED_OFF); |
| phonemacro | 0:252077cb2ac5 | 70 | DigitalOut bLED(LED3, LED_OFF); |
| phonemacro | 0:252077cb2ac5 | 71 | gLED = LED_ON; |
| phonemacro | 0:252077cb2ac5 | 72 | printf("MAX31875 Small Package Temperature Sensor example source code.\r\n"); |
| phonemacro | 0:252077cb2ac5 | 73 | printf("\r\n"); |
| phonemacro | 0:252077cb2ac5 | 74 | |
| phonemacro | 0:252077cb2ac5 | 75 | MAX31875 temp_sensor(i2cBus, MAX31875_I2C_SLAVE_ADR_R0); |
| phonemacro | 0:252077cb2ac5 | 76 | i2cBus.frequency(400000); |
| phonemacro | 0:252077cb2ac5 | 77 | |
| phonemacro | 0:252077cb2ac5 | 78 | /* Configure for fault filter 1, comparator, continuous, |
| phonemacro | 0:252077cb2ac5 | 79 | * normal format, 8 sps, 12 bit resolution |
| phonemacro | 0:252077cb2ac5 | 80 | */ |
| phonemacro | 0:252077cb2ac5 | 81 | #if 0 |
| phonemacro | 0:252077cb2ac5 | 82 | temp_sensor.write_cfg(uint16_t(MAX31875_CFG_FAULT_FILTER_1 | |
| phonemacro | 0:252077cb2ac5 | 83 | MAX31875_CFG_COMPARATOR_MODE | MAX31875_CFG_CONTINUOUS | |
| phonemacro | 0:252077cb2ac5 | 84 | MAX31875_CFG_NORMAL_FORMAT | MAX31875_CFG_CONV_RATE_8 | |
| phonemacro | 0:252077cb2ac5 | 85 | MAX31875_CFG_RESOLUTION_12BIT)); |
| phonemacro | 0:252077cb2ac5 | 86 | #endif |
| phonemacro | 0:252077cb2ac5 | 87 | for (i = 0; i < 10; i++) { |
| phonemacro | 0:252077cb2ac5 | 88 | wait(MAX31875_WAIT_CONV_TIME_9BIT); |
| phonemacro | 0:252077cb2ac5 | 89 | temperature = temp_sensor.read_reg_as_temperature(MAX31875_REG_TEMPERATURE); |
| phonemacro | 0:252077cb2ac5 | 90 | printf("Temperature = %3.4f Celsius, %3.4f Fahrenheit\r\n", |
| phonemacro | 0:252077cb2ac5 | 91 | temperature, temp_sensor.celsius_to_fahrenheit(temperature)); |
| phonemacro | 0:252077cb2ac5 | 92 | } |
| phonemacro | 0:252077cb2ac5 | 93 | temperature = temp_sensor.read_reg_as_temperature(MAX31875_REG_TOS_HIGH_TRIP); |
| phonemacro | 0:252077cb2ac5 | 94 | printf("TOS Temperature = %3.4f Celsius, %3.4f Fahrenheit\r\n", |
| phonemacro | 0:252077cb2ac5 | 95 | temperature, temp_sensor.celsius_to_fahrenheit(temperature)); |
| phonemacro | 0:252077cb2ac5 | 96 | #if 0 |
| phonemacro | 0:252077cb2ac5 | 97 | temp_sensor.read_reg(&cfg, MAX31875_REG_CONFIGURATION); |
| phonemacro | 0:252077cb2ac5 | 98 | printf("Configuration Register = 0x%04Xh \r\n", cfg); |
| phonemacro | 0:252077cb2ac5 | 99 | #if 0 |
| phonemacro | 0:252077cb2ac5 | 100 | temp_sensor.write_trip_low(-63.9375); |
| phonemacro | 0:252077cb2ac5 | 101 | wait(0.03); |
| phonemacro | 0:252077cb2ac5 | 102 | temperature = temp_sensor.read_reg_as_temperature(MAX31875_REG_THYST_LOW_TRIP); |
| phonemacro | 0:252077cb2ac5 | 103 | printf("Thyst Temperature = %3.4f Celsius, %3.4f Fahrenheit\r\n", |
| phonemacro | 0:252077cb2ac5 | 104 | temperature, temp_sensor.celsius_to_fahrenheit(temperature)); |
| phonemacro | 0:252077cb2ac5 | 105 | |
| phonemacro | 0:252077cb2ac5 | 106 | temp_sensor.write_trip_high(64.0625f); |
| phonemacro | 0:252077cb2ac5 | 107 | wait(0.03); |
| phonemacro | 0:252077cb2ac5 | 108 | temperature = temp_sensor.read_reg_as_temperature(MAX31875_REG_TOS_HIGH_TRIP); |
| phonemacro | 0:252077cb2ac5 | 109 | printf("TOS Temperature = %3.4f Celsius, %3.4f Fahrenheit\r\n", |
| phonemacro | 0:252077cb2ac5 | 110 | temperature, temp_sensor.celsius_to_fahrenheit(temperature)); |
| phonemacro | 0:252077cb2ac5 | 111 | printf("\r\n\r\n"); |
| phonemacro | 0:252077cb2ac5 | 112 | #endif |
| phonemacro | 0:252077cb2ac5 | 113 | |
| phonemacro | 0:252077cb2ac5 | 114 | printf("\r\n"); |
| phonemacro | 0:252077cb2ac5 | 115 | |
| phonemacro | 0:252077cb2ac5 | 116 | /* Configure for fault filter 4, interrupt, shutdown, |
| phonemacro | 0:252077cb2ac5 | 117 | * extended format, 0.25 sps, 10 bit resolution, start one-shot |
| phonemacro | 0:252077cb2ac5 | 118 | */ |
| phonemacro | 0:252077cb2ac5 | 119 | for (i = 0; i < 2; i++) { |
| phonemacro | 0:252077cb2ac5 | 120 | temp_sensor.write_cfg(uint16_t(MAX31875_CFG_FAULT_FILTER_4 | |
| phonemacro | 0:252077cb2ac5 | 121 | MAX31875_CFG_INTERRUPT_MODE | MAX31875_CFG_SHUTDOWN | |
| phonemacro | 0:252077cb2ac5 | 122 | MAX31875_CFG_EXTENDED_FORMAT| MAX31875_CFG_CONV_RATE_0_25 | |
| phonemacro | 0:252077cb2ac5 | 123 | MAX31875_CFG_RESOLUTION_10BIT | MAX31875_CFG_ONE_SHOT_START)); |
| phonemacro | 0:252077cb2ac5 | 124 | wait(MAX31875_WAIT_CONV_RATE_0_25); |
| phonemacro | 0:252077cb2ac5 | 125 | temperature = temp_sensor.read_reg_as_temperature(MAX31875_REG_TEMPERATURE); |
| phonemacro | 0:252077cb2ac5 | 126 | printf("Temperature = %3.4f Celsius, %3.4f Fahrenheit\r\n", |
| phonemacro | 0:252077cb2ac5 | 127 | temperature, temp_sensor.celsius_to_fahrenheit(temperature)); |
| phonemacro | 0:252077cb2ac5 | 128 | } |
| phonemacro | 0:252077cb2ac5 | 129 | temp_sensor.read_reg(&cfg, MAX31875_REG_CONFIGURATION); |
| phonemacro | 0:252077cb2ac5 | 130 | printf("Configuration Register = 0x%04Xh \r\n", cfg); |
| phonemacro | 0:252077cb2ac5 | 131 | |
| phonemacro | 0:252077cb2ac5 | 132 | printf("\r\n\r\n"); |
| phonemacro | 0:252077cb2ac5 | 133 | |
| phonemacro | 0:252077cb2ac5 | 134 | #if 0 |
| phonemacro | 0:252077cb2ac5 | 135 | temp_sensor.write_trip_low(-127.9375); |
| phonemacro | 0:252077cb2ac5 | 136 | wait(0.03); |
| phonemacro | 0:252077cb2ac5 | 137 | temp_sensor.read_reg(&cfg, MAX31875_REG_CONFIGURATION); |
| phonemacro | 0:252077cb2ac5 | 138 | temperature = temp_sensor.read_reg_as_temperature(MAX31875_REG_THYST_LOW_TRIP); |
| phonemacro | 0:252077cb2ac5 | 139 | printf("Thyst Temperature = %3.4f Celsius, %3.4f Fahrenheit\r\n", |
| phonemacro | 0:252077cb2ac5 | 140 | temperature, temp_sensor.celsius_to_fahrenheit(temperature)); |
| phonemacro | 0:252077cb2ac5 | 141 | |
| phonemacro | 0:252077cb2ac5 | 142 | temp_sensor.write_trip_high(129.0625f); |
| phonemacro | 0:252077cb2ac5 | 143 | wait(0.03); |
| phonemacro | 0:252077cb2ac5 | 144 | temperature = temp_sensor.read_reg_as_temperature(MAX31875_REG_TOS_HIGH_TRIP); |
| phonemacro | 0:252077cb2ac5 | 145 | printf("TOS Temperature = %3.4f Celsius, %3.4f Fahrenheit\r\n", |
| phonemacro | 0:252077cb2ac5 | 146 | temperature, temp_sensor.celsius_to_fahrenheit(temperature)); |
| phonemacro | 0:252077cb2ac5 | 147 | printf("\r\n\r\n"); |
| phonemacro | 0:252077cb2ac5 | 148 | #endif |
| phonemacro | 0:252077cb2ac5 | 149 | |
| phonemacro | 0:252077cb2ac5 | 150 | /*************************************************************************** |
| phonemacro | 0:252077cb2ac5 | 151 | * Call the C code version of the driver |
| phonemacro | 0:252077cb2ac5 | 152 | *************************************************************************** |
| phonemacro | 0:252077cb2ac5 | 153 | */ |
| phonemacro | 0:252077cb2ac5 | 154 | #include "max31875_c.h" |
| phonemacro | 0:252077cb2ac5 | 155 | printf("C implementation of the code\r\n"); |
| phonemacro | 0:252077cb2ac5 | 156 | max31875_init(MAX31875_I2C_SLAVE_ADR_R0); |
| phonemacro | 0:252077cb2ac5 | 157 | /* Configure for fault filter 1, comparator, continuous, |
| phonemacro | 0:252077cb2ac5 | 158 | * normal format, 8 sps, 12 bit resolution |
| phonemacro | 0:252077cb2ac5 | 159 | */ |
| phonemacro | 0:252077cb2ac5 | 160 | max31875_write_cfg(uint16_t(MAX31875_CFG_FAULT_FILTER_1 | |
| phonemacro | 0:252077cb2ac5 | 161 | MAX31875_CFG_COMPARATOR_MODE | MAX31875_CFG_CONTINUOUS | |
| phonemacro | 0:252077cb2ac5 | 162 | MAX31875_CFG_NORMAL_FORMAT | MAX31875_CFG_CONV_RATE_8 | |
| phonemacro | 0:252077cb2ac5 | 163 | MAX31875_CFG_RESOLUTION_12BIT), i2cBus); |
| phonemacro | 0:252077cb2ac5 | 164 | for (i = 0; i < 10; i++) { |
| phonemacro | 0:252077cb2ac5 | 165 | wait(MAX31875_WAIT_CONV_RATE_8); |
| phonemacro | 0:252077cb2ac5 | 166 | temperature = max31875_read_reg_as_temperature(MAX31875_REG_TEMPERATURE, |
| phonemacro | 0:252077cb2ac5 | 167 | i2cBus); |
| phonemacro | 0:252077cb2ac5 | 168 | printf("Temperature = %3.4f Celsius, %3.4f Fahrenheit\r\n", |
| phonemacro | 0:252077cb2ac5 | 169 | temperature, temp_sensor.celsius_to_fahrenheit(temperature)); |
| phonemacro | 0:252077cb2ac5 | 170 | } |
| phonemacro | 0:252077cb2ac5 | 171 | max31875_read_reg(&cfg, MAX31875_REG_CONFIGURATION, i2cBus); |
| phonemacro | 0:252077cb2ac5 | 172 | printf("Configuration Register = 0x%04Xh \r\n", cfg); |
| phonemacro | 0:252077cb2ac5 | 173 | |
| phonemacro | 0:252077cb2ac5 | 174 | #if 0 |
| phonemacro | 0:252077cb2ac5 | 175 | max31875_write_trip_low(-63.9375, i2cBus); |
| phonemacro | 0:252077cb2ac5 | 176 | wait(0.03); |
| phonemacro | 0:252077cb2ac5 | 177 | temperature = max31875_read_reg_as_temperature(MAX31875_REG_THYST_LOW_TRIP, i2cBus); |
| phonemacro | 0:252077cb2ac5 | 178 | printf("Thyst Temperature = %3.4f Celsius, %3.4f Fahrenheit\r\n", |
| phonemacro | 0:252077cb2ac5 | 179 | temperature, max31875_celsius_to_fahrenheit(temperature)); |
| phonemacro | 0:252077cb2ac5 | 180 | |
| phonemacro | 0:252077cb2ac5 | 181 | max31875_write_trip_high(64.0625f, i2cBus); |
| phonemacro | 0:252077cb2ac5 | 182 | wait(0.03); |
| phonemacro | 0:252077cb2ac5 | 183 | temperature = max31875_read_reg_as_temperature(MAX31875_REG_TOS_HIGH_TRIP, i2cBus); |
| phonemacro | 0:252077cb2ac5 | 184 | printf("TOS Temperature = %3.4f Celsius, %3.4f Fahrenheit\r\n", |
| phonemacro | 0:252077cb2ac5 | 185 | temperature, max31875_celsius_to_fahrenheit(temperature)); |
| phonemacro | 0:252077cb2ac5 | 186 | #endif |
| phonemacro | 0:252077cb2ac5 | 187 | |
| phonemacro | 0:252077cb2ac5 | 188 | printf("\r\n"); |
| phonemacro | 0:252077cb2ac5 | 189 | for (i = 0; i < 2; i++) { |
| phonemacro | 0:252077cb2ac5 | 190 | max31875_write_cfg(uint16_t(MAX31875_CFG_FAULT_FILTER_4 | |
| phonemacro | 0:252077cb2ac5 | 191 | MAX31875_CFG_INTERRUPT_MODE | MAX31875_CFG_SHUTDOWN | |
| phonemacro | 0:252077cb2ac5 | 192 | MAX31875_CFG_EXTENDED_FORMAT| MAX31875_CFG_CONV_RATE_0_25 | |
| phonemacro | 0:252077cb2ac5 | 193 | MAX31875_CFG_RESOLUTION_10BIT | MAX31875_CFG_ONE_SHOT_START), |
| phonemacro | 0:252077cb2ac5 | 194 | i2cBus); |
| phonemacro | 0:252077cb2ac5 | 195 | wait(MAX31875_WAIT_CONV_RATE_0_25); |
| phonemacro | 0:252077cb2ac5 | 196 | temperature = max31875_read_reg_as_temperature(MAX31875_REG_TEMPERATURE, |
| phonemacro | 0:252077cb2ac5 | 197 | i2cBus); |
| phonemacro | 0:252077cb2ac5 | 198 | 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 | 0:252077cb2ac5 | 201 | max31875_read_reg(&cfg, MAX31875_REG_CONFIGURATION, i2cBus); |
| phonemacro | 0:252077cb2ac5 | 202 | printf("Configuration Register = 0x%04Xh \r\n", cfg); |
| phonemacro | 0:252077cb2ac5 | 203 | |
| phonemacro | 0:252077cb2ac5 | 204 | #if 0 |
| phonemacro | 0:252077cb2ac5 | 205 | temp_sensor.write_trip_low(-127.9375); |
| phonemacro | 0:252077cb2ac5 | 206 | max31875_write_trip_low(-127.9375, i2cBus); |
| phonemacro | 0:252077cb2ac5 | 207 | wait(0.03); |
| phonemacro | 0:252077cb2ac5 | 208 | temperature = max31875_read_reg_as_temperature(MAX31875_REG_THYST_LOW_TRIP, i2cBus); |
| phonemacro | 0:252077cb2ac5 | 209 | printf("Thyst Temperature = %3.4f Celsius, %3.4f Fahrenheit\r\n", |
| phonemacro | 0:252077cb2ac5 | 210 | temperature, max31875_celsius_to_fahrenheit(temperature)); |
| phonemacro | 0:252077cb2ac5 | 211 | |
| phonemacro | 0:252077cb2ac5 | 212 | max31875_write_trip_high(129.0625f, i2cBus); |
| phonemacro | 0:252077cb2ac5 | 213 | wait(0.03); |
| phonemacro | 0:252077cb2ac5 | 214 | temperature = max31875_read_reg_as_temperature(MAX31875_REG_TOS_HIGH_TRIP, i2cBus); |
| phonemacro | 0:252077cb2ac5 | 215 | printf("TOS Temperature = %3.4f Celsius, %3.4f Fahrenheit\r\n", |
| phonemacro | 0:252077cb2ac5 | 216 | temperature, max31875_celsius_to_fahrenheit(temperature)); |
| phonemacro | 0:252077cb2ac5 | 217 | #endif |
| phonemacro | 0:252077cb2ac5 | 218 | #endif |
| phonemacro | 0:252077cb2ac5 | 219 | printf("\r\n\r\n\r\n"); |
| phonemacro | 0:252077cb2ac5 | 220 | |
| phonemacro | 0:252077cb2ac5 | 221 | |
| phonemacro | 0:252077cb2ac5 | 222 | while (true) { // Blink the green LED |
| phonemacro | 0:252077cb2ac5 | 223 | gLED = !gLED; |
| phonemacro | 0:252077cb2ac5 | 224 | wait(0.5); |
| phonemacro | 0:252077cb2ac5 | 225 | } |
| phonemacro | 0:252077cb2ac5 | 226 | } |
| phonemacro | 0:252077cb2ac5 | 227 | |
| phonemacro | 0:252077cb2ac5 | 228 |