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.
Fork of Repo_Noeud_Mobile by
Diff: main.cpp
- Revision:
- 30:389d09853cd1
- Parent:
- 22:cccb77300fd5
- Child:
- 32:7bdaac2c4cbf
--- a/main.cpp Thu Mar 26 17:08:26 2015 +0000 +++ b/main.cpp Mon Apr 06 18:43:51 2015 +0000 @@ -62,11 +62,11 @@ int main(void const* args) { - m_pc.printf("==== PROGRAM START MOBILE ====\r\n"); + m_pc.printf("\r\n==== PROGRAM START MOBILE ====\r\n"); // Initializing the accelerometer ReadConfig(); //read config file - m_pc.printf("PANID %#04x\r\n", PanId); + m_pc.printf("PANID %x\r\n", PanId); xbee = new Xbee(PanId, p13, p14); //set PAN ID #if ACTIVATE_ACCEL @@ -99,8 +99,8 @@ threads[1] = &thread1; threads[2] = &thread2; #endif - while(true) { + } } @@ -240,15 +240,17 @@ FILE* file = fopen("/local/config.txt","r"); if (file != NULL) { - char buffer[2]; + char buffer[10] = "00000000"; //char time; //char selector; - fscanf(file, "%x", &buffer); //panID = 2 char + fscanf(file,"%s %x", buffer, &PanId); + + //fscanf(file, "%x", &buffer); //panID = 2 char //fscanf(file, "%d", &time); //read period = 1 decimal //fscanf(file, "%d", &selector); //end device selector = 1 decimal - PanId = buffer[1] << 8 | buffer[0]; //set PAN ID global variable + //PanId = buffer[1] << 8 | buffer[0]; //set PAN ID global variable //ReadPeriod = time; //set read period global variable //EndDeviceSelection = selector; //set end device selection global variable