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.
Revision 0:93a79d0fe805, committed 2014-05-08
- Comitter:
- tim007
- Date:
- Thu May 08 15:23:44 2014 +0000
- Commit message:
- LV8-PAI-Grupa6-Tim007
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 May 08 15:23:44 2014 +0000 @@ -0,0 +1,32 @@ +#include "mbed.h" +Serial pc (USBTX, USBRX); +BusIn columns(dp9,dp10,dp11,dp13); +BusOut rows(dp2, dp1, dp28, dp6); +Timer deb; + +char button(){ + char character[16] = {'1','2','3','A','4','5','6','B','7','8','9','C','*','0','#','D'}; + for(int i = 0; i <= 3; i++) + { + rows = (1 << i); + for(int j = 0; j <= 3; j++) + if(columns == (1 << j)){ + if (deb.read_ms()<400) return NULL; + deb.reset(); + return character[ i * 4 + j ]; + } + } + return NULL; + } +void display(){ + char c = button(); + if (c==NULL) return; + if (c=='*') pc.putc ('\n'); + else pc.putc (c); + + } +int main() { + rows=0; + deb.start(); + while(1){display();} +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu May 08 15:23:44 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/8a40adfe8776 \ No newline at end of file