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: ublox-cellular-base ublox-cellular-driver-gen battery-charger-bq24295 gnss
Revision 0:25fcf12b0ba2, committed 2017-09-19
- Comitter:
- euygun
- Date:
- Tue Sep 19 12:23:17 2017 +0000
- Child:
- 1:e11c75d931b5
- Commit message:
- Creation
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Tue Sep 19 12:23:17 2017 +0000
@@ -0,0 +1,94 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2017 u-blox
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "mbed.h"
+#include "UbloxCellularDriverGen.h"
+#include "onboard_modem_api.h"
+
+// User LEDs
+DigitalOut ledRed(LED1, 1);
+DigitalOut ledGreen(LED2, 1);
+DigitalOut ledBlue(LED3, 1);
+
+// Ethernet socket LED
+DigitalOut ledYellow(LED4,1);
+
+// User Button
+#ifdef TARGET_UBLOX_C027
+ // No user button on C027
+ InterruptIn userButton(NC);
+#else
+ InterruptIn userButton(SW0);
+#endif
+
+// Delay between LED changes in second
+volatile float delay = 0.5;
+
+//To check if the user pressed the User Button or not
+void threadBodyUserButtonCheck(void const *args){
+ float delayToggle = delay;
+ while (1){
+ if (userButton.read() == 1 ) {
+ //User Button is pressed
+ delay = 0.1;
+ //Indicate the button is pressed
+ ledYellow = 0;
+ }
+ else {
+ //User button is released
+ delay = 0.5;
+ //Turn off the Yellow LED on Ethernet socket
+ ledYellow = 1;
+ }
+ }
+}
+
+/*
+** Out of the Box Demo for C030 variants
+**
+** Sets the modem then
+*/
+
+int main()
+{
+ //Initialised the modem
+ onboard_modem_init();
+
+ //Power up the modem
+ onboard_modem_power_up();
+
+ //Create threadUserButtonCheck thread
+ Thread threadUserButtonCheck(threadBodyUserButtonCheck);
+
+ //Set the LED states
+ ledRed = 0;
+ ledGreen = 1;
+ ledBlue = 1;
+
+ printf("u-blox C030 Out-of-the-Box Demo\n\r");
+
+ //Main loop
+ while(1) {
+ wait(delay);
+ //Shift the LED states
+ int carry = ledBlue;
+ ledBlue = ledRed;
+ ledRed = ledGreen;
+ ledGreen = carry;
+ }
+}
+
+// End Of File
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-os.lib Tue Sep 19 12:23:17 2017 +0000 @@ -0,0 +1,1 @@ +https://github.com/ARMmbed/mbed-os/#ca661f9d28526ca8f874b05432493a489c9671ea
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ublox-cellular-base.lib Tue Sep 19 12:23:17 2017 +0000 @@ -0,0 +1,1 @@ +https://developer.mbed.org/teams/ublox/code/ublox-cellular-base/#8fadf1e49487
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ublox-cellular-driver-gen.lib Tue Sep 19 12:23:17 2017 +0000 @@ -0,0 +1,1 @@ +https://developer.mbed.org/teams/ublox/code/ublox-cellular-driver-gen/#a9eea2dbdd68