11 years ago.

Cant get start

HI I'm a beginner trying to use Smart GPU 2 with mbed LPC 1768, I simply imported the code as below, and connect p13,p14,p15 to SMART GPU2 as defined in 'SMARTGPU2.h' But after reset, the screen return to the initial picture of Smart GPU2, the code doesn't seem work! Can anyone tell me what's wrong ? Thank you very much. "

  1. include "mbed.h"
  2. include "SMARTGPU2.h"

SMARTGPU2 lcd(TXPIN,RXPIN,RESETPIN); create our object called "lcd"

void initializeSmartGPU2(void){ Initialize SMARTGPU2 Board lcd.reset(); physically reset SMARTGPU2 lcd.start(); initialize the SMARTGPU2 processor }

int main() { POINT p1, p2, p3; COLOUR colour; FILLGEOM fill;

initializeSmartGPU2(); Init communication with SmartGPU2 board

lcd.baudChange(BAUD7); set a fast baud! for fast drawing

while(1){forever p1.x= (rand()%LCD_WIDTH); get a random number 0-319 p1.y= (rand()%LCD_HEIGHT); get a random number 0-239 p2.x= (rand()%LCD_WIDTH); get a random number 0-319 p2.y= (rand()%LCD_HEIGHT); get a random number 0-239 p3.x= (rand()%LCD_WIDTH); get a random number 0-319 p3.y= (rand()%LCD_HEIGHT); get a random number 0-239 colour= (rand()%65536); get a random number 0-65535 fill=(FILLGEOM)(rand()%2); get a random number 0-1

draw the triangle if(lcd.drawTriangle(p1.x, p1.y, p2.x, p2.y, p3.x, p3.y, colour,fill) != 'O'){ draw random triangles while(1); loop forever if different than 'O'OK } } }"

Question relating to:

My two comments. Make sure you set the comm port correctly in the .h file and selected the correct display size there too. Also, be sure to load the NEW examples, they work a lot better. Start off with the clock example and you can go from there. I'm having a great time with mine. Bo

posted by bo barry 01 May 2014

1 Answer

11 years ago.

It has been replied numerous times, but please use <<code>> and <</code>> tags around your posted code to keep it readable....

How did you wire the display to mbed:

  • the display RX pin should be connected to mbed TX pin (p13),
  • the display TX pin should be connected to mbed RX pin (p14).
  • note that the display and mbed need to have a shared ground. Did you power the display from mbed 3V3 (p40) and mbed GND (p1)

See http://www.vizictechnologies.com/#!smartgpu-2/c1rc2

Accepted Answer