realizamos la primera parte del laboratorio realizando un programa en el cual se pueda ingresar fácilmente cualquier letra o símbolo en una matriz 7x5

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
Paxtel
Date:
Wed Mar 15 19:32:25 2017 +0000
Commit message:
matriz 7x5 primera parte laboratorio

Changed in this revision

mbed.bld Show annotated file Show diff for this revision Revisions of this file
p2.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r fa46384c7525 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Mar 15 19:32:25 2017 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/e1686b8d5b90
\ No newline at end of file
diff -r 000000000000 -r fa46384c7525 p2.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/p2.cpp	Wed Mar 15 19:32:25 2017 +0000
@@ -0,0 +1,172 @@
+#include "mbed.h"
+
+
+BusOut Rows (PA_8, PA_5, PA_10, PB_3, PB_5, PB_4, PB_10);
+BusOut Cols (PA_6, PA_7, PB_6, PC_7, PA_9);
+#define WT 5
+
+int i=0;
+int j=1;
+int k=1;
+
+void print_rows(unsigned char vr,unsigned char vc)
+{
+    Rows =vr;
+    Cols =vc;
+    wait_ms(WT);
+
+}
+
+
+void print_matrix(unsigned char r1,unsigned char r2, unsigned char  r3, unsigned char r4, unsigned char r5)
+{
+
+    print_rows (r1,0b11110);
+    print_rows (r2,0b11101);
+    print_rows (r3,0b11011);
+    print_rows (r4,0b10111);
+    print_rows (r5,0b01111);
+
+}
+
+
+int main()
+{
+    int i;
+    while(1) {
+        for(i=0; i< 1000000; i++)
+            print_matrix(0b1111110,0b0001001,0b0001001,0b0001001,0b1111110);  // print X
+
+        for(i=0; i< 1000000; i++)
+            print_matrix(0x55, 0xaa,0x55,0xaa,0x55);  // print X
+
+    }
+
+    /*
+     do{
+
+     wait_ms(WT);
+
+     do{
+
+                        Cols =0x20;   //A
+                        Rows =0x09;
+                        wait_ms(5);
+                        Cols =0x0e;
+                        Rows =0x7F;
+                        wait_ms(5);
+                        i=(i+j);
+
+
+               }while(i<150);
+
+               wait_ms(30);
+               i=0;
+
+               do{
+
+
+                        Cols =0x0e;   //B
+                        Rows =0x7F;
+                        wait_ms(5);
+                        Cols =0x20;
+                        Rows =0x49;
+                        wait_ms(5);
+                        i=(i+j);
+
+
+               }while(i<150);
+
+
+                wait_ms(30);
+               i=0;
+
+               do{
+
+
+                        Cols =0x20;   //c
+                        Rows =0x41;
+                        wait_ms(5);
+                        Cols =0x4f;
+                        Rows =0x7f;
+                        wait_ms(5);
+                        i=(i+j);
+
+
+               }while(i<150);
+
+                wait_ms(30);
+               i=0;
+
+               do{
+
+
+                        Cols =0x2e;   //X
+                        Rows =0x63;
+                        wait_ms(5);
+                        Cols =0x15;
+                        Rows =0x14;
+                        wait_ms(5);
+                        Cols =0x1b;
+                        Rows =0x08;
+                        wait_ms(5);
+                        i=(i+j);
+
+
+               }while(i<150);
+
+                 wait_ms(30);
+               i=0;
+
+               do{
+
+
+                        Cols =0x2e;   //y
+                        Rows =0x03;
+                        wait_ms(5);
+                        Cols =0x15;
+                        Rows =0x04;
+                        wait_ms(5);
+                        Cols =0x1b;
+                        Rows =0xf8;
+                        wait_ms(5);
+                        i=(i+j);
+
+
+               }while(i<150);
+
+                 wait_ms(30);
+               i=0;
+
+               do{
+
+
+                        Cols =0x00;   //z
+                        Rows =0x63;
+                        wait_ms(5);
+                        Cols =0x1d;
+                        Rows =0x04;
+                        wait_ms(5);
+                        Cols =0x1b;
+                        Rows =0x08;
+                         wait_ms(5);
+                        Cols =0x17;
+                        Rows =0x10;
+                        wait_ms(5);
+                        i=(i+j);
+
+
+               }while(i<150);
+
+
+               Cols =0x1f;
+                Rows =0x00;
+                wait_ms(5);
+                i=0;
+
+                }while(k>0);
+
+
+
+      */
+}
\ No newline at end of file