Работяги / Mbed 2 deprecated posos

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
DioBrando
Date:
Fri Mar 23 13:44:18 2018 +0000
Child:
1:a3f2963a13e1
Commit message:
pss;

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	Fri Mar 23 13:44:18 2018 +0000
@@ -0,0 +1,44 @@
+#include "mbed.h"
+
+DigitalOut myled(LED1);
+
+bool buttonBox[5][5] = 0;
+bool ledBox[5][5] = 0;
+DigitalOut gridPinsX[5] = {D2, D3, D4, D5, D6};
+DigitalIn gridPinsY[5] = {D7, D8, D9, D10, D11};
+
+
+int main()
+{
+
+    mainLoop();
+
+}
+
+
+
+void mainLoop()
+{
+    while(1) {
+
+        myled = 1; // LED is ON
+        wait(0.2); // 200 ms
+        myled = 0; // LED is OFF
+        wait(1.0); // 1 sec
+
+    }
+}
+
+void checkState(bool matchLeds)  //turn matchLeds ON to match LED and button matrixes
+{
+    for(int x = 0; x<5; x++) {
+        gridPinsX[x] = 1;
+        for(int y = 0; y<5; y++) {
+            buttonBox[x][y] = gridPinsY[y];
+            if(matchLeds) {
+                ledBox[x][y] = buttonBox[x][y];
+            }
+        }
+        gridPinsX[x] = 0;
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Mar 23 13:44:18 2018 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/994bdf8177cb
\ No newline at end of file