LCD_ST7735 help

09 Mar 2016

Hi all,

I wonder if anyone can help me with my code. I'm trying to get the LCD_ST7735 to work with my LPC1768. I've got the library into my code and defined the header of the lcd library. But I see no reference to SPI there (which it uses). So the code doesn't compile. Can anyone confirm to me that I do need to do the SPI thing first?

Another suspicion is that I am not initiating the LCD_ST7735 constructor correctly (as in line 7 below):

My code is like this so far...

#include "mbed.h"
#include "LCD_ST7735.h"
#include "Color565.h"
#include "SPI.h"

LCD_ST7735 tftscreen(p9,p10,p11,p5,p6,p7,p8);
int main() 
{
    tftscreen.clearScreen();
    tftscreen.drawCircle(50,50,20,'Blue');
    wait(5);
    tftscreen.clearScreen();
}

Hope to have answer soon, it's so frustrating because I thought I knew C (but not C++). Thanks in advance.

11 Mar 2016

Hi I started a new blank project with the LPC1768. I added the LCD_ST7735 library. Then I took your main.cpp program and *slightly* modified it. It compiled.

Example derived from LCD_ST7735 library

#include "mbed.h"
#include "LCD_ST7735.h"
//#include "Color565.h"
//#include "SPI.h"
 
LCD_ST7735 tftscreen(p9,p10,p11,p5,p6,p7,p8);
int main() 
{
    tftscreen.clearScreen();
    tftscreen.drawCircle(50,50,20,'Blue');
    wait(5);
    tftscreen.clearScreen();
}
12 Mar 2016

Hi, thanks for the reply. It's still not working. By thatI mean it compiles, but doesn't do anything to the board.

I've tried everything and it does nothing. The above code should work right? What fundamental stuff could I be missing that would cause it to not work? i know the screen works because I hooked it up to an Arduino yesterday.

Do I need to activate the spi pins before defining then at the initialising part? I really want(ed) this board to work to be honest.

Thanks in advance.

13 Mar 2016

Without digging down into the details something else is wrong. No, you don't need to initialize the SPI pins that is the function of the driver. Could they be something wrong? Maybe. Check the pins on your board vs the assignments. Check the schematic of the LCD display. Possibly an electrical conflict between the two. Other things to do are to add some debug print statements at various points in the driver and see what's going on.

Please log in to post a reply.