BLE Lightning sensor for Nordic NRF51822 based module
Dependencies: AS3935 AS3935_ext BLE_API mbed nRF51822 nrf51_rtc
Diff: main.cpp
- Revision:
- 2:e1e638cbf972
- Parent:
- 1:a4119049dd99
- Child:
- 3:2ea547dab8a8
diff -r a4119049dd99 -r e1e638cbf972 main.cpp --- a/main.cpp Thu Aug 27 16:18:20 2015 +0000 +++ b/main.cpp Sun Aug 30 06:27:27 2015 +0000 @@ -94,7 +94,7 @@ init_timeinfo->tm_hour = 0; init_timeinfo->tm_mon = 0; init_timeinfo->tm_mday = 1; - init_timeinfo->tm_year = 0; + init_timeinfo->tm_year = 70; char date[24]; strftime(date,sizeof(date),"%H:%M:%S on %m/%d/%G",init_timeinfo); @@ -186,15 +186,17 @@ int hz=0; //initialisations + wait(1); DEBUG("reset\r\n"); Lightning.reset(); DEBUG("setTuneCap as 5\r\n"); Lightning.setTuneCap(5); // Tuning Parameter DEBUG("powerup\r\n"); Lightning.powerUp(); - DEBUG("setOutdoors\r\n"); - Lightning.setOutdoors(); // Set Device into Outdoor mode - + + DEBUG("set Indoor Mode as 0x0d\r\n"); + Lightning.registerWrite(AS3935_AFE_GB,0x0d); + DEBUG("Auto Calibration Start\r\n"); float minerr = 100; int fincap = 7;