Vizic Technologies
/
Ellipses_SG2
Ellipses - MBED + SmartGPU2 board
Diff: main.cpp
- Revision:
- 0:fac3a822a910
- Child:
- 1:974361f7ce8c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Jul 10 03:27:38 2013 +0000 @@ -0,0 +1,51 @@ +/**************************************************************************************/ +/*SMARTGPU2 intelligent embedded graphics processor unit + those examples are for use the SMARTGPU2 with the mbed microcontoller, just connect tx,rx,and reset + Board: + http://vizictechnologies.com/#/smart-gpu-2/4577779046 + + www.vizictechnologies.com + Vizic Technologies copyright 2013 */ +/**************************************************************************************/ + +#include "mbed.h" +#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 point; + RADIUS radiusx, radiusy; + COLOUR colour; + FILLGEOM fill; + + initializeSmartGPU2(); //Init communication with SmartGPU2 board + + lcd.baudChange(BAUD7); //set a fast baud! for fast drawing + + while(1){//forever + point.x= (rand()%LCD_WIDTH); //get a random number 0-319 + point.y= (rand()%LCD_HEIGHT); //get a random number 0-239 + radiusx= (rand()%81)+1; //get a random number 1-80 + radiusy= (rand()%81)+1; //get a random number 1-80 + colour= (rand()%65536); //get a random number 0-65535 + fill=(FILLGEOM)(rand()%2); //get a random number 0-1 + + //draw the Ellipse + if(lcd.drawEllipse(point.x,point.y,radiusx,radiusy,colour,fill) != 'O'){ //draw an Ellipse + while(1); //loop forever if different than 'O'--OK + } + } +} \ No newline at end of file