very basic test for writing to the lcd
Revision 0:6d0f15553359, committed 2012-09-21
- Comitter:
- openobc
- Date:
- Fri Sep 21 12:59:11 2012 +0000
- Commit message:
- tested and working
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Fri Sep 21 12:59:11 2012 +0000
@@ -0,0 +1,44 @@
+#include "mbed.h"
+
+//all this does is set up the lcd and write a bunch of 9s to it
+
+int main()
+{
+ Serial debug(P0_2, P0_3);
+ debug.baud(115200);
+ printf("hi\r\n");
+
+ DigitalOut* outRst = new DigitalOut(P0_19);
+
+ SPI* spi1 = new SPI(P0_9, P0_8, P0_7);
+ DigitalOut* lcdUnk0 = new DigitalOut(P0_5);
+ DigitalOut* lcdUnk1 = new DigitalOut(P2_6);
+ DigitalOut* lcdCs = new DigitalOut(P2_7);
+ DigitalOut* lcdRefresh = new DigitalOut(P1_28);
+
+ *lcdCs = true;
+ *lcdRefresh = false;
+ *lcdUnk0 = true;
+ *lcdUnk1 = false;
+
+ PwmOut* lcdClock = new PwmOut(P1_26);
+ lcdClock->period((float)1/80000);
+ lcdClock->pulsewidth((float)1/80000*0.9);
+
+ wait(1);
+
+ *lcdCs = false;
+ for(int i = 0; i < 24; i++)
+ {
+ spi1->write('9');
+ }
+ spi1->write(0);
+ spi1->write(' ');
+ spi1->write(' ');
+ spi1->write(' ');
+
+ *lcdRefresh = true;
+ wait_ms(1);
+ *lcdRefresh = false;
+ *lcdCs = true;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri Sep 21 12:59:11 2012 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/cd19af002ccc \ No newline at end of file