x
Dependencies: gnss battery-charger-bq24295
Diff: main.cpp
- Revision:
- 3:b9051f3f2fcd
- Parent:
- 2:c95852ac6953
- Child:
- 5:8f44dab9cb6b
--- a/main.cpp Tue Sep 26 15:41:17 2017 +0000 +++ b/main.cpp Wed Jan 10 17:03:44 2018 +0000 @@ -15,6 +15,7 @@ */ #include "mbed.h" +#include "gnss.h" #include "battery_charger_bq24295.h" #include "UbloxCellularDriverGen.h" #include "onboard_modem_api.h" @@ -27,6 +28,9 @@ DigitalOut ledGreen(LED2, 1); DigitalOut ledBlue(LED3, 1); +//GNSS 1V8_MAX IO power +DigitalOut GNSSOn(GNSSEN, 1); + // Ethernet socket LED DigitalOut ledYellow(LED4,1); @@ -38,6 +42,9 @@ InterruptIn userButton(SW0); #endif +// GNSS +GnssSerial gnss; + // i2c3 Bus I2C i2c3(I2C_SDA_B, I2C_SCL_B); @@ -74,6 +81,16 @@ int main() { + printf("u-blox C030 Out-of-the-Box Demo\n\r"); + + // GNSS initialisation + if(gnss.init()) { + printf("GNSS initialised.\n\r"); + } + else { + printf("GNSS initialisation failure.\n\r"); + } + // The battery charger initialisation charger.init(&i2c3); charger.setInputVoltageLimit(MIN_INPUT_VOLTAGE_LIMIT_MV); @@ -89,12 +106,16 @@ // Create threadUserButtonCheck thread Thread threadUserButtonCheck(threadBodyUserButtonCheck); + + //Set GNSS IO On + GNSSOn = 1; + // Set the LED states ledRed = 0; ledGreen = 1; ledBlue = 1; - printf("u-blox C030 Out-of-the-Box Demo\n\r"); + printf("u-blox C030 Out-of-the-Box Demo: LED loop\n\r"); //Main loop while(1) {