TheEmbedded / Mbed 2 deprecated mbed_blinky

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
patter23
Date:
Thu Feb 21 17:20:33 2019 +0000
Commit message:
Test

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /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
+        
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Feb 21 17:20:33 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/3a7713b1edbc
\ No newline at end of file