Liam Faruq / Mbed 2 deprecated MAX7456_2

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "MAX7456.h"
00003 
00004 MAX7456 vo (p5,p6,p7,p20,p19);
00005 DigitalOut myled(LED1);
00006 Serial pc(USBTX, USBRX); // tx, rx
00007 
00008 int main() {
00009 
00010 vo.format('P');
00011 vo.setdarkness();
00012 vo.initaddress();
00013 
00014 vo.test();
00015 vo.htrim('+',20);
00016 vo.vtrim('-',4);
00017 
00018 vo.cls();
00019 
00020 /**
00021 vo.locate(1,1);
00022 vo.printf("Hello World");
00023 wait(3.0);
00024 vo.cls();
00025 **/
00026 
00027 
00028 int count = 0;
00029 vo.invert(0);
00030 for (int y = 0 ; y < 16 ; y++) {
00031      for (int x = 0 ; x < 30 ; x++) {
00032         vo.locate(x,y);
00033         count= count+1;
00034         vo.putc('1');
00035         wait(0.01);
00036         printf("/%d/",count);
00037         }
00038 }
00039 wait(1.5);
00040 vo.invert(0);
00041 vo.locate(1,0);
00042 vo.putc('G');
00043 
00044 vo.locate(1,1);
00045 vo.putc('G');
00046 
00047 vo.locate(1,2);
00048 vo.putc('G');
00049 
00050 vo.locate(1,3);
00051 vo.putc('G');
00052 
00053 
00054 
00055 /*
00056 vo.locate(1,1);
00057 vo.printf("good bye");
00058 wait(2.0);
00059 vo.locate(1,1);
00060 vo.printf("error");
00061 */
00062 }