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: mbed
Diff: main.cpp
- Revision:
- 0:254a855b2bf5
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Thu Feb 21 17:20:33 2019 +0000
@@ -0,0 +1,47 @@
+//incudes the API header file
+#include "mbed.h"
+
+//Connected on board led1 to digitial out
+DigitalOut myled(LED1); //onboard led1
+DigitalOut yourled(LED2); //onboard led2
+DigitalOut outLed1(p20); //breadboard led - pin 20
+DigitalOut outLed2(p21); //breadboard led - pin 21
+DigitalOut SquareWave(p19); //squarewave output - pin 7
+
+//main loop area
+int main() {
+ while(1) {
+ /*
+ // ONBOARD LED 1
+ myled = 1; //sets the led high
+ wait(0.1); //wait for 0.1 seconds
+ myled.write(0); //sets the led low - different way to write this
+ wait(0.5); //wait for 0.5 seconds
+
+ // ONBOARD LED 2
+ yourled = 1; //sets the led high
+ wait(0.1); //wait for 0.1 seconds
+ yourled.write(0); //sets the led low - different way to write this
+ wait(0.5); //wait for 0.5 seconds
+
+
+ // BREADBOARD LED 1 - PIN 20
+ outLed1 = 1; //sets the led high
+ wait(0.1); //wait for 0.1 seconds
+ outLed1.write(0); //sets the led low - different way to write this
+ wait(0.5); //wait for 0.5 seconds
+
+ // BREADBOARD LED 1 - PIN 21
+ outLed2 = 1; //sets the led high
+ wait(0.1); //wait for 0.1 seconds
+ outLed2.write(0); //sets the led low - different way to write this
+ wait(0.5); //wait for 0.5 seconds
+ */
+ // SQUAREWAVE - PIN 19
+ SquareWave = 1; //sets the output high
+ wait(.01); //wait for 10 ms
+ SquareWave.write(0); //sets the output low - different way to write this
+ wait(.01); //wait for 10 ms
+
+ }
+}