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: mbed mbed-rtos 4DGL-uLCD-SE SDFileSystem ATParser
Revision 1:8eb0ee57df9f, committed 2020-04-20
- Comitter:
- chenchen2020
- Date:
- Mon Apr 20 04:30:14 2020 +0000
- Parent:
- 0:bedc25613430
- Child:
- 2:f65d4206b47b
- Commit message:
- Working - Code (Backtrack)
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Mon Apr 20 02:19:40 2020 +0000
+++ b/main.cpp Mon Apr 20 04:30:14 2020 +0000
@@ -43,6 +43,7 @@
}
void parse_RSSI(){
+ at.send("AT+BLEGETRSSI") && at.read(buffer, 10);
if(buffer[0] == '-'){
pc.printf("RSSI: ");
pc.putc(buffer[1]);
@@ -54,8 +55,7 @@
if (averageCount <= 15){
RSSI_array[averageCount] = total;
}
- averageCount++;
-
+ averageCount++;
if(averageCount > 15 && buffer[0] == '-'){
averageCount = 0;
int average = calculate_average(RSSI_array, 15);
@@ -74,7 +74,6 @@
pc.printf("%i\n", risk_level);
}else{
pc.printf("Disconnected\n");
-
}
}
@@ -102,19 +101,11 @@
pc.baud(9600);
ble.baud(9600);
- //Thread SD_Thread();
- //Thread ULCD_Thread();
- //Thread LED_Thread();
- //Thread Speaker_Thread();
-
+ Thread SD_Thread();
+ Thread ULCD_Thread();
+ Thread LED_Thread();
+ Thread Speaker_Thread();
while(1) {
- //wait(0.05);
- at.send("AT+BLEGETRSSI") && at.read(buffer, 10);
- /*for(int i = 0; i < 10; i++){
- pc.putc(buffer[i]);
- }*/
parse_RSSI();
- //pc.putc("\n");
- //pc.putc();
}
}
\ No newline at end of file