Fork of Dimiter program. "Wait" commands adjusted and added Arial 10 font.
Fork of KS0108 by
Diff: KS0108.cpp
- Revision:
- 6:7c0770d5639d
- Parent:
- 5:e4b50f4c13a8
--- a/KS0108.cpp Mon May 02 19:05:30 2011 +0000 +++ b/KS0108.cpp Sat Jan 10 23:46:14 2015 +0000 @@ -24,11 +24,11 @@ SelectSide(side); //select controller - wait(0.0000003); //wait 300ns + wait_us(1); //wait 1 microsecond. This is the smallest resolution of the wait funtion (see mbed handbook). E.write(1); DB.output(); DB.write(Command); - wait(0.0000001); + wait_us(1); E.write(0); } @@ -40,11 +40,11 @@ SelectSide(side); - wait(0.0000003); // 300ns + wait_us(1); E = 1; DB.output(); DB.write(data); - wait(0.0000001); + wait_us(1); E = 0; } @@ -54,7 +54,7 @@ if(Coord.x >= SCREEN_WIDTH) return; chip = Coord.x/CHIP_WIDTH; - wait(0.000000450); // 300ns + wait_us(1); if(Coord.x % CHIP_WIDTH == 0 && chip > 0){ GotoXY(Coord.x, Coord.y); @@ -78,9 +78,9 @@ displayData |= data << yOffset; if(Inverted) displayData = ~displayData; DB.write(displayData); // write data - wait(0.0000003); // 300ns + wait_us(1); E.write(1); - wait(0.0000001); + wait_us(1); E.write(0); // second page @@ -100,9 +100,9 @@ displayData = ~displayData; DB.write(displayData); // write data - wait(0.0000003); // 300ns + wait_us(1); E.write(1); - wait(0.0000001); + wait_us(1); E.write(0); GotoXY(Coord.x+1, Coord.y-8); @@ -111,11 +111,11 @@ // just this code gets executed if the write is on a single page if(Inverted) data = ~data; - wait(0.0000003); // 300nsEN_DELAY(); + wait_us(1); // EN_DELAY(); DB.write(data); // write data - wait(0.0000003); // 300ns + wait_us(1); E = 1; - wait(0.0000001); + wait_us(1); E = 0; Coord.x++; } @@ -155,10 +155,10 @@ RW.write(1); E.write(1); - wait(0.00000045); + wait_us(1); data = DB.read(); - wait(0.0000001); + wait_us(1); E.write(0); DB.output(); @@ -173,11 +173,11 @@ RW.write(1); E.write(1); - wait(0.00000045); + wait_us(1); status = DB.read(); E.write(0); - wait(0.0000001); + wait_us(1); DB.output(); return status;