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: ADS1115 BME280 CronoDot SDFileSystem mbed
Fork of Outdoor_UPAS_v1_2_Tboard by
Revision 33:03d0e7f5ef0a, committed 2016-04-25
- Comitter:
- jelord
- Date:
- Mon Apr 25 21:32:27 2016 +0000
- Parent:
- 30:aa6324845a84
- Child:
- 34:da333abe3476
- Commit message:
- Support for Second Home Micro.; Termination byte added to end of transmission to app
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Mon Apr 25 15:56:38 2016 +0000
+++ b/main.cpp Mon Apr 25 21:32:27 2016 +0000
@@ -227,6 +227,7 @@
else if(rx_buf[0] == 0x07)transmissionValue = 7; //Serial Number
else if(rx_buf[0] == 0x08)transmissionValue = 8; //Run Enable
else if(rx_buf[0] == 0x0A)transmissionValue = 10; //GPS Coordinates
+ else if(rx_buf[0] == 0x0B)transmissionValue = 11; //GPS Coordinates (Second Set)
//else if(rx_buf[0] == 0x30)RGB_LED.set_led(1,0,0);
else transmissionValue = 100; //Not useful data
}
@@ -296,6 +297,8 @@
if(dataLength ==2)E2PROM.write(0x00034,writeData,2);
}else if (transmissionValue == 10){
if(dataLength == 16)E2PROM.write(0x00050,writeData,16);
+ }else if (transmissionValue == 11){
+ if(dataLength == 8)E2PROM.write(0x00060,writeData,8);
}
dataLength++;
@@ -319,11 +322,13 @@
uint8_t flowRateOriginal[5] = {0x04,0x00,0x00,0x80,0x3F};
uint8_t serialBytes[3] = {0x07,0x00,0x00};
uint8_t latLongSchoolOriginal[17] = {0x0A,0x00,0x00,0x80,0x3F,0x00,0x00,0x80,0x3F,0x00,0x00,0x80,0x3F,0x00,0x00,0x80,0x3F};
+ uint8_t latLongHome2[9] = {0x0B,0x00,0x00,0x80,0x3F,0x00,0x00,0x80,0x3F};
// Latitude School EEPROM = 0x50-0x53
// Longitude School EEPROM = 0x54-0x57
// Latitude Home EEPROM = 0x58-0x5B
// Longitude Home EEPROM = 0x5C-0x5F
uint8_t NEW_EEPROM_CHECK[1] = {0,}; //THIS IS USED TO ENSURE COOPERATION WITH MOBILE APPS
+ uint8_t TERMINATE_BYTE[1] = {0xff,}; //used for compatibility with android app
//NEW EEPROM Check bit = 0x75
E2PROM.read(0x00075,NEW_EEPROM_CHECK,1);
@@ -335,6 +340,7 @@
E2PROM.read(0x00010,flowRateOriginal+1,4);
E2PROM.read(0x00034,serialBytes+1,2);
E2PROM.read(0x00050,latLongSchoolOriginal+1,16);
+ E2PROM.read(0x00060,latLongHome2+1,8);
}else{
NEW_EEPROM_CHECK[0] = 0x0A;
E2PROM.write(0x00075,NEW_EEPROM_CHECK,1);
@@ -344,32 +350,40 @@
E2PROM.write(0x00010,flowRateOriginal+1,4);
E2PROM.write(0x00034,serialBytes+1,2);
E2PROM.write(0x00050,latLongSchoolOriginal+1,16);
+ E2PROM.write(0x00060,latLongHome2+1,8);
}
for(int i=0; i<13; i++){
microChannel.putc(sampleTimePassValues[i]);
}
- wait(.25);
+ wait(.15);
for(int i=0; i<9; i++){
microChannel.putc(subjectLabelOriginal[i]);
}
- wait(.25);
+ wait(.15);
for(int i=0; i<2; i++){
microChannel.putc(dataLogOriginal[i]);
}
- wait(.25);
+ wait(.15);
for(int i=0; i<5; i++){
microChannel.putc(flowRateOriginal[i]);
}
- wait(.25);
+ wait(.15);
for(int i=0;i<17;i++){
microChannel.putc(latLongSchoolOriginal[i]);
}
+ wait(.15);
+
+ for(int i=0;i<9;i++){
+ microChannel.putc(latLongHome2[i]);
+ }
+ wait(.15);
+ microChannel.putc(TERMINATE_BYTE[0]);
}
