123

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
lucem1n
Date:
Wed Jul 03 07:59:55 2019 +0000
Commit message:
123

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
diff -r 000000000000 -r 03476464e975 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Jul 03 07:59:55 2019 +0000
@@ -0,0 +1,46 @@
+#include "mbed.h"
+
+InterruptIn ePin(PC_0);
+Serial pc(USBTX, USBRX);
+//DigitalIn a(PC_3);
+//DigitalIn b(PC_2);
+//DigitalIn c(PC_6);
+//DigitalIn d(PC_8);
+//DigitalIn e(PC_9);
+//DigitalIn f(PC_10);
+//DigitalIn g(PC_11);
+//DigitalIn h(PC_12);
+
+
+uint16_t inputBytes;
+uint8_t thereIsInputFlag = 0;
+
+PortIn  Portc(PortC, (1<<3)|(1<<2)|(1<<6)|(1<<8)|(1<<9)|(1<<10)|(1<<11)|(1<<12)); //(1<<10)|(1<<11)|...
+//PortIn  Porta(PortA, (1<<13)|(1<<14)|(1<<15)); 
+
+void inputHandler(){
+
+     inputBytes = Portc.read();
+     thereIsInputFlag = 1;
+}
+
+int main()
+{
+    ePin.mode(PullUp);
+    //a.mode(PullDown);
+    //b.mode(PullDown);
+    //c.mode(PullDown);
+    //d.mode(PullDown);
+    //e.mode(PullDown);
+    //f.mode(PullDown);
+    //g.mode(PullDown);
+    //h.mode(PullDown);          
+    pc.baud(19200);
+    ePin.fall(&inputHandler);
+    while(1){
+        if(thereIsInputFlag) {
+                pc.printf("%X", inputBytes);
+                thereIsInputFlag = 0;
+        }
+    }
+}
diff -r 000000000000 -r 03476464e975 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Jul 03 07:59:55 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file