Kiselica Aldin Muslija Adnan

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
tim008
Date:
Mon May 05 07:40:58 2014 +0000
Commit message:
LV8_PAI_Tim008_Z2

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 feb8c38ed947 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon May 05 07:40:58 2014 +0000
@@ -0,0 +1,54 @@
+#include "mbed.h"
+
+Serial pc(USBTX, USBRX);
+
+DigitalOut rows[4]={dp2,dp1,dp28,dp6};
+DigitalIn columns[4]={dp9,dp10,dp11,dp13};
+
+Ticker ticker;
+char giveChar()
+{
+    char value=0;
+    for(int i=0;i<4;i++)
+    {
+        rows[i]=1;
+        for(int j=0;j<4;j++)
+        {
+            if( i<3 && j<3 && columns[j] )
+                value= '1'+(i*3+j);
+                
+            if(j==3 && columns[j] )
+                value= 'a'+i;
+            if(i==3 && columns[j] )
+            {
+                if(j==0)
+                    value= '*';
+                if(j==1)
+                    value= '0';
+                if(j==2)
+                    value='#';
+            }
+        }
+        rows[i]=0;
+        if(value!=0)
+            break;
+    }            
+    return value;   
+}
+
+void displayChar()
+{
+    char c=giveChar();
+    if(c==0)
+    return;
+    if(c!='*')
+        pc.putc(c);
+    else if(c=='*')
+        pc.putc('\n');
+}
+int main() {
+    ticker.attach(displayChar,0.2);
+    while(1) {
+    
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r feb8c38ed947 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon May 05 07:40:58 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/8a40adfe8776
\ No newline at end of file