Daniel Lee / Mbed OS mbed-os-example-cellular-le910
Revision:
51:8d0212a4b805
Parent:
42:cab443dff75e
diff -r 5378d3f64df1 -r 8d0212a4b805 main.cpp
--- a/main.cpp	Wed Dec 04 12:02:03 2019 +0000
+++ b/main.cpp	Fri Feb 07 07:04:18 2020 +0000
@@ -235,6 +235,53 @@
     return -1;
 }
 
+void init_SkyWire4G()
+{
+    DigitalOut myled(LED1);                             // Main LED
+    DigitalOut skywire_en(D12);                        // Skywire Enable
+    DigitalOut skywire_rts(D11);                       // Skywire Send
+    DigitalOut green_LED(A1);                         // Green LED
+    DigitalOut red_LED(A2);                           // Red LED
+    DigitalOut blue_LED(A3);                          // Blue LED
+
+    AnalogIn photo_trans(A0);                         // Photo Transistor
+    AnalogIn pot(A5);                                 // Potentiometer
+    DigitalIn button1(D3);                            // Button 1
+    DigitalIn button2(A4);                            // Button 2
+#if 0
+    I2C i2c(D14,D15);                                 // Setup I2C bus for sensors
+
+    LPS331 pressure(i2c);                               // Pressure Sensor
+    LM75B LM75_temp(D14,D15);                         // Temp Sensor
+    // Accelerometer
+    LIS3DH accel(i2c, LIS3DH_V_CHIP_ADDR, LIS3DH_DR_NR_LP_100HZ, LIS3DH_FS_2G);
+    HTS221 humidity(D14, D15);                        // Humidity Sensor
+#endif
+
+    // Turn on blue LED
+    green_LED = 0;
+    red_LED = 0;
+    blue_LED = 1;
+
+    skywire_rts=0;
+    myled=0;
+    printf("Starting Skywire board with LE910-EUG Demo...\n");
+    printf("Waiting for Skywire to Boot...\n");
+
+    //Enable Skywire
+    skywire_en=0;
+    ThisThread::sleep_for(2000);
+    skywire_en=1;
+    ThisThread::sleep_for(2000);
+    skywire_en=0;
+
+    myled=1;
+        
+    printf("Wait 15 seconds..\n");
+    ThisThread::sleep_for(15000);
+}
+
+
 int main()
 {
     print_function("\n\nmbed-os-example-cellular\n");
@@ -243,6 +290,7 @@
     print_function("\n\n[MAIN], plmn: %s\n", (MBED_CONF_NSAPI_DEFAULT_CELLULAR_PLMN ? MBED_CONF_NSAPI_DEFAULT_CELLULAR_PLMN : "NULL"));
 #endif
 
+    init_SkyWire4G();
     print_function("Establishing connection\n");
 #if MBED_CONF_MBED_TRACE_ENABLE
     trace_open();