Vizic Technologies
/
House
SMARTGPU drawing figures demo!
main.cpp@0:8ab32fd6eb85, 2011-09-14 (annotated)
- Committer:
- emmanuelchio
- Date:
- Wed Sep 14 05:31:55 2011 +0000
- Revision:
- 0:8ab32fd6eb85
Rev 1.0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
emmanuelchio | 0:8ab32fd6eb85 | 1 | /**************************************************************************************/ |
emmanuelchio | 0:8ab32fd6eb85 | 2 | /*SMARTGPU intelligent embedded graphics processor unit |
emmanuelchio | 0:8ab32fd6eb85 | 3 | those examples are for use the SMARTGPU with the mbed microcontoller, just connect tx,rx,and reset |
emmanuelchio | 0:8ab32fd6eb85 | 4 | Board: |
emmanuelchio | 0:8ab32fd6eb85 | 5 | http://www.vizictechnologies.com/#/desarrollo/4554296549 |
emmanuelchio | 0:8ab32fd6eb85 | 6 | |
emmanuelchio | 0:8ab32fd6eb85 | 7 | www.vizictechnologies.com |
emmanuelchio | 0:8ab32fd6eb85 | 8 | Vizic Technologies copyright 2011 */ |
emmanuelchio | 0:8ab32fd6eb85 | 9 | /**************************************************************************************/ |
emmanuelchio | 0:8ab32fd6eb85 | 10 | /**************************************************************************************/ |
emmanuelchio | 0:8ab32fd6eb85 | 11 | |
emmanuelchio | 0:8ab32fd6eb85 | 12 | #include "mbed.h" |
emmanuelchio | 0:8ab32fd6eb85 | 13 | #include "SMARTGPU.h" |
emmanuelchio | 0:8ab32fd6eb85 | 14 | |
emmanuelchio | 0:8ab32fd6eb85 | 15 | //Some colour definitions |
emmanuelchio | 0:8ab32fd6eb85 | 16 | #define orange 0xFC0F |
emmanuelchio | 0:8ab32fd6eb85 | 17 | #define brown 0xBBCA |
emmanuelchio | 0:8ab32fd6eb85 | 18 | #define ligBlue 0x96DD |
emmanuelchio | 0:8ab32fd6eb85 | 19 | |
emmanuelchio | 0:8ab32fd6eb85 | 20 | SMARTGPU lcd(p13,p14,p15); //(TX,RX,Reset); |
emmanuelchio | 0:8ab32fd6eb85 | 21 | |
emmanuelchio | 0:8ab32fd6eb85 | 22 | |
emmanuelchio | 0:8ab32fd6eb85 | 23 | int main() { |
emmanuelchio | 0:8ab32fd6eb85 | 24 | lcd.reset(); //physically reset SMARTGPU |
emmanuelchio | 0:8ab32fd6eb85 | 25 | lcd.start(); //initialize the SMARTGPU processor |
emmanuelchio | 0:8ab32fd6eb85 | 26 | |
emmanuelchio | 0:8ab32fd6eb85 | 27 | //draw the house |
emmanuelchio | 0:8ab32fd6eb85 | 28 | lcd.drawRectangle(78,134,212,217,orange,FILL); //draw a rectangle |
emmanuelchio | 0:8ab32fd6eb85 | 29 | lcd.drawRectangle(78,134,212,217,BLACK,UNFILL); //draw a rectangle |
emmanuelchio | 0:8ab32fd6eb85 | 30 | lcd.drawTriangle(75,133,216,133,146,63,RED,FILL); //draw a triangle |
emmanuelchio | 0:8ab32fd6eb85 | 31 | lcd.drawTriangle(75,133,216,133,146,63,BLACK,UNFILL); //draw a triangle |
emmanuelchio | 0:8ab32fd6eb85 | 32 | lcd.drawRectangle(136,167,170,217,brown,FILL); //draw a rectangle |
emmanuelchio | 0:8ab32fd6eb85 | 33 | lcd.drawRectangle(136,167,170,217,BLACK,UNFILL); //draw a rectangle |
emmanuelchio | 0:8ab32fd6eb85 | 34 | lcd.drawCircle(106,160,15,ligBlue,FILL); //draw a circle |
emmanuelchio | 0:8ab32fd6eb85 | 35 | lcd.drawCircle(106,160,15,BLACK,UNFILL); //draw a circle |
emmanuelchio | 0:8ab32fd6eb85 | 36 | lcd.drawCircle(195,187,10,ligBlue,FILL); //draw a circle |
emmanuelchio | 0:8ab32fd6eb85 | 37 | lcd.drawCircle(195,187,10,BLACK,UNFILL); //draw a circle |
emmanuelchio | 0:8ab32fd6eb85 | 38 | |
emmanuelchio | 0:8ab32fd6eb85 | 39 | //draw left tree |
emmanuelchio | 0:8ab32fd6eb85 | 40 | lcd.drawRectangle(25,157,45,218,brown,FILL); //draw a rectangle |
emmanuelchio | 0:8ab32fd6eb85 | 41 | lcd.drawRectangle(25,157,45,218,BLACK,UNFILL); //draw a rectangle |
emmanuelchio | 0:8ab32fd6eb85 | 42 | lcd.drawCircle(35,120,35,GREEN,FILL); //draw a circle |
emmanuelchio | 0:8ab32fd6eb85 | 43 | lcd.drawCircle(35,120,35,BLACK,UNFILL); //draw a circle |
emmanuelchio | 0:8ab32fd6eb85 | 44 | //draw right tree |
emmanuelchio | 0:8ab32fd6eb85 | 45 | lcd.drawRectangle(270,167,283,218,brown,FILL); //draw a rectangle |
emmanuelchio | 0:8ab32fd6eb85 | 46 | lcd.drawRectangle(270,167,283,218,BLACK,UNFILL); //draw a rectangle |
emmanuelchio | 0:8ab32fd6eb85 | 47 | lcd.drawCircle(277,134,35,GREEN,FILL); //draw a circle |
emmanuelchio | 0:8ab32fd6eb85 | 48 | lcd.drawCircle(277,134,35,BLACK,UNFILL); //draw a circle |
emmanuelchio | 0:8ab32fd6eb85 | 49 | |
emmanuelchio | 0:8ab32fd6eb85 | 50 | //draw grass |
emmanuelchio | 0:8ab32fd6eb85 | 51 | lcd.drawLine(5,218,314,218,GREEN); //draw a line |
emmanuelchio | 0:8ab32fd6eb85 | 52 | |
emmanuelchio | 0:8ab32fd6eb85 | 53 | //loop forever |
emmanuelchio | 0:8ab32fd6eb85 | 54 | while(1); |
emmanuelchio | 0:8ab32fd6eb85 | 55 | } |