Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 0:6d0f15553359
diff -r 000000000000 -r 6d0f15553359 main.cpp
--- /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;
+}