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
p2.cpp
- Committer:
- Paxtel
- Date:
- 2017-03-15
- Revision:
- 0:fa46384c7525
File content as of revision 0:fa46384c7525:
#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); */ }