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: SDFileSystem max32630fthr USBDevice
Fork of FTHR_SD_Demo by
Diff: main.cpp
- Revision:
- 30:3a1d9c2b49a5
- Parent:
- 29:88f36da6a119
- Child:
- 31:2e7483c7281b
--- a/main.cpp Fri May 10 19:33:26 2019 +0000
+++ b/main.cpp Tue May 28 18:14:55 2019 +0000
@@ -5,6 +5,7 @@
#include <ctype.h>
#define PERIOD 10 // Logging period in seconds
+#define CONVERT_T_DELAY 30
//OT07 Registers
#define OT07_STATUS 0x00 // OT07 status regiter
@@ -908,7 +909,7 @@
if(n == 2){//get temperatures from selected device
convert_temperature(OT07[device].I2C_address); //send OW convert selected device
- wait(0.02); //wait 20 ms for convert temperature to complete
+ wait_ms(CONVERT_T_DELAY); //wait 20 ms for convert temperature to complete
T[device] = get_temperature(OT07[device].I2C_address);
pc.printf("device[%02X] temperature[%.3f] status[%d]\r\n",device,T[device].tempC, T[device].status);
}
@@ -920,7 +921,7 @@
for(j=device;j<=arg1;j++){
convert_temperature(OT07[j].I2C_address); //send convert to all devices
- wait(0.02); //wait 20ms for convert temperature to complete
+ wait_ms(CONVERT_T_DELAY); //wait 20ms for convert temperature to complete
T[j] = get_temperature(OT07[j].I2C_address);
}
@@ -950,7 +951,7 @@
if(rx_index>0)rx_index--;//remove last char from buffer if not at start.
}else rx_index++;
}//end while(pc.redable())
- wait(0.1); // slow down polling
+ wait_ms(100); // slow down polling
}// end (while tick == false)
tick_flag = false; // set to false for next time
@@ -962,7 +963,7 @@
for(j=0;j<device_count;j++){
convert_temperature(OT07[j].I2C_address);
- wait(0.02); //wait 20ms for convert temperature to complete
+ wait_ms(CONVERT_T_DELAY); //wait 20ms for convert temperature to complete
T[j] = get_temperature(OT07[j].I2C_address);
}
/////////////////////////////////////////////////////////////////////////////////////////////////
