UART object

Dependencies:   mbed

Fork of DigoleSerialDisp1 by James Novak

Committer:
jdbunda
Date:
Sun Nov 22 16:01:18 2015 +0000
Revision:
6:fc42c0dc7b7f
New DigoleSerialDisp UART object

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jdbunda 6:fc42c0dc7b7f 1 #include "mbed.h"
jdbunda 6:fc42c0dc7b7f 2 #include "DigoleSerialDisp.h"
jdbunda 6:fc42c0dc7b7f 3
jdbunda 6:fc42c0dc7b7f 4 DigoleSerialDisp display(dp11, dp12);//UART DigoleSerialDisp(PinName TX, PinName RX);
jdbunda 6:fc42c0dc7b7f 5
jdbunda 6:fc42c0dc7b7f 6 int main (int argc, char**argv)
jdbunda 6:fc42c0dc7b7f 7 {
jdbunda 6:fc42c0dc7b7f 8 // display.baud(9600);
jdbunda 6:fc42c0dc7b7f 9 wait(1); //wait for DigoleSerialDisp to power up
jdbunda 6:fc42c0dc7b7f 10
jdbunda 6:fc42c0dc7b7f 11
jdbunda 6:fc42c0dc7b7f 12 display.write("CL\r");
jdbunda 6:fc42c0dc7b7f 13
jdbunda 6:fc42c0dc7b7f 14
jdbunda 6:fc42c0dc7b7f 15 while(1)
jdbunda 6:fc42c0dc7b7f 16 {
jdbunda 6:fc42c0dc7b7f 17 display.write("SD3\r\n");//set rotation 0=0deg,1=90deg,2=180deg,3=270deg
jdbunda 6:fc42c0dc7b7f 18 display.write("TRT");//offset Line 1 in housing
jdbunda 6:fc42c0dc7b7f 19 display.write("SF3\rTT Line 1\r\n");
jdbunda 6:fc42c0dc7b7f 20 display.write("TRT");//next line
jdbunda 6:fc42c0dc7b7f 21 wait(0.5);
jdbunda 6:fc42c0dc7b7f 22 display.write("SF3\r\n");
jdbunda 6:fc42c0dc7b7f 23 display.write("CT5\r\n");//set contrast (0-30)
jdbunda 6:fc42c0dc7b7f 24 display.write("ESC0f0\r\n");
jdbunda 6:fc42c0dc7b7f 25 //display.write("SD0\r\n");//set rotation 0=0deg,1=90deg,2=180deg,3=270deg
jdbunda 6:fc42c0dc7b7f 26 display.write("TT Line 2\r\n");
jdbunda 6:fc42c0dc7b7f 27 display.write("TRT");
jdbunda 6:fc42c0dc7b7f 28 wait(0.5);
jdbunda 6:fc42c0dc7b7f 29 display.write("SF3\r\n");
jdbunda 6:fc42c0dc7b7f 30 display.write("ESC6\r\n");
jdbunda 6:fc42c0dc7b7f 31 display.write("CT10\r\n");//set contrast (0-30)
jdbunda 6:fc42c0dc7b7f 32 //display.write("SD1\r\n");//set rotation 0=0deg,1=90deg,2=180deg,3=270deg
jdbunda 6:fc42c0dc7b7f 33 display.write("TT Line 3\r\n");
jdbunda 6:fc42c0dc7b7f 34 display.write("TRT");
jdbunda 6:fc42c0dc7b7f 35 wait(0.5);
jdbunda 6:fc42c0dc7b7f 36 display.write("SF3\r\n");
jdbunda 6:fc42c0dc7b7f 37 display.write("ESC16\r\n");
jdbunda 6:fc42c0dc7b7f 38 display.write("CT80\r\n");//set contrast (0-30)
jdbunda 6:fc42c0dc7b7f 39 //display.write("SD2\r\n");//set rotation 0=0deg,1=90deg,2=180deg,3=270deg
jdbunda 6:fc42c0dc7b7f 40 display.write("TT Line 4\r\n");
jdbunda 6:fc42c0dc7b7f 41 display.write("TRT");
jdbunda 6:fc42c0dc7b7f 42 wait(0.5);
jdbunda 6:fc42c0dc7b7f 43 display.write("SF3\r\n");
jdbunda 6:fc42c0dc7b7f 44 display.write("ESC1ff\r");
jdbunda 6:fc42c0dc7b7f 45 display.write("CT20\r\n");//set contrast (0-30)
jdbunda 6:fc42c0dc7b7f 46 //display.write("SD3\r\n");//set rotation 0=0deg,1=90deg,2=180deg,3=270deg
jdbunda 6:fc42c0dc7b7f 47 display.write("TT Line 5\r\n");
jdbunda 6:fc42c0dc7b7f 48 display.write("TRT");
jdbunda 6:fc42c0dc7b7f 49 wait(0.5);
jdbunda 6:fc42c0dc7b7f 50 display.write("SF3\r\n");
jdbunda 6:fc42c0dc7b7f 51 display.write("ESC0f\r\n");
jdbunda 6:fc42c0dc7b7f 52 display.write("CT525\r\n");//set contrast (0-30)
jdbunda 6:fc42c0dc7b7f 53 display.write("TT Line 6\r\n");
jdbunda 6:fc42c0dc7b7f 54 display.write("TRT");
jdbunda 6:fc42c0dc7b7f 55 wait(0.5);
jdbunda 6:fc42c0dc7b7f 56 display.write("BL100\r\n");
jdbunda 6:fc42c0dc7b7f 57 display.write("TRT");
jdbunda 6:fc42c0dc7b7f 58 wait(0.5);
jdbunda 6:fc42c0dc7b7f 59 //display.write("FR1111\r\n");
jdbunda 6:fc42c0dc7b7f 60 wait(1);
jdbunda 6:fc42c0dc7b7f 61 display.write("CL\r\n");
jdbunda 6:fc42c0dc7b7f 62
jdbunda 6:fc42c0dc7b7f 63
jdbunda 6:fc42c0dc7b7f 64 display.drawLine(10,10,100,100);
jdbunda 6:fc42c0dc7b7f 65 display.drawCircle(20,20,20,20);
jdbunda 6:fc42c0dc7b7f 66 // display.write("Testing the display.");
jdbunda 6:fc42c0dc7b7f 67 //DigoleSerialDisp.write(0xD);
jdbunda 6:fc42c0dc7b7f 68 wait(1);
jdbunda 6:fc42c0dc7b7f 69 }
jdbunda 6:fc42c0dc7b7f 70 }