Fork of SPI18TFT: Ported to Seeeduino-Arch-Pro and tested with SainSmart 1.8 ST7735R TFT
Fork of SPI18TFT by
This port of the SPI18TFT demo program was to see if I could get a: SainSmart 1.8 ST7735R TFT LCD module to work with a Seeeduino-Arch-Pro mbed platform.
The gotcha is that this LCD module does not have an MSIO pin, and the MSIO pin on the Arch-Pro must be left disconnected.
Diff: main.cpp
- Revision:
- 1:71477b6fe9a4
- Parent:
- 0:309c546f048d
--- a/main.cpp Sun Dec 11 21:14:33 2011 +0000 +++ b/main.cpp Sun Dec 21 07:09:12 2014 +0000 @@ -1,3 +1,12 @@ + /* + *********************************************** + This works great on the Seeeduino-Arch-Pro using + the SainSmart 1.8" ST7735R TFT + provided the wiring for the SPI bus is correct... + the MSIO pin can not be used for RS... + it must be disconnected + *********************************************** + */ #include "stdio.h" #include "stdlib.h" #include "math.h" @@ -52,7 +61,18 @@ // the TFT is connected to SPI pin 5-7, CS is p8, RS is p11, reset is p15 - ST7735_TFT TFT(p5, p6, p7, p8, p11, p15,"TFT"); // mosi, miso, sclk, cs, rs, reset + // ST7735_TFT TFT(p5, p6, p7, p8, p11, p15,"TFT"); // mosi, miso, sclk, cs, rs, reset + ST7735_TFT TFT(P0_9,P0_8,P0_7,P0_6,P0_0,P2_13,"TFT"); // + +// Pins on the display PIN on ARCH_Pro +// VCC -- 3.3V +// GND -- GND +// SCL -- P0_7 +// SDA -- P0_9 +// RS /DC -- P0_0 +// RES -- P2_13 +// CS -- P0_6 +// -- P0_8 -- connection not used on display (sould be MISO) Serial pc(USBTX, USBRX); // tx, rx Timer t; @@ -60,6 +80,7 @@ extern unsigned char p1[]; // the mbed logo int main() { + printf("Getting Started Now\n\r"); unsigned int centerx, centery; int i, j, tempx, tempy; @@ -70,18 +91,22 @@ TFT.claim(stdout); // send stdout to the TFT display - //TFT.claim(stderr); // send stderr to the TFT display + TFT.claim(stderr); // send stderr to the TFT display TFT.background(Black); // set background to black TFT.foreground(White); // set chars to white TFT.cls(); - TFT.set_font((unsigned char*) Arial24x23); // select the font - + TFT.set_font((unsigned char*) Arial12x12); // select the font + + TFT.printf("Getting Started\nLine two\nLine three\r\nEnd"); + pc.printf("Getting Started\nLine two\nLine three\r\nEnd"); t.start(); - + wait_ms(5000); ////// demo start + printf("\n\n\n\n\nStart Time %f s\n", t.read()); + TFT.set_font((unsigned char*) Arial24x23); // select the font for ( j = 0 ; j < 10000; j++ ) {