Jump to content
RobG

(Universal) Color LCD graphics library (2)

Recommended Posts

Draw TI Logo function

 

post-73-0-88751900-1381240782_thumb.jpg

const u_char ti1[10] = { 94, 36, 109, 36, 97, 92, 82, 92, 94, 36 };
const u_char ti2[82] = { 0, 58, 41, 58, 41, 0, 80, 0, 80, 25, 88, 28, 84, 47,
		72, 47, 68, 65, 80, 65, 76, 84, 75, 95, 76, 103, 82, 110, 94, 112, 110,
		107, 115, 93, 106, 93, 104, 90, 110, 65, 122, 65, 126, 47, 114, 47, 118,
		29, 148, 32, 148, 54, 156, 65, 154, 95, 130, 106, 116, 120, 111, 134,
		114, 149, 98, 150, 80, 138, 62, 104, 54, 97, 46, 99, 38, 106, 30, 104,
		20, 88, 0, 58 };

///////////////////////////
// TI Logo
///////////////////////////
void drawTILogo(u_int x, u_int y, u_int color) {
	u_char sx = 0;
	u_char sy = 0;
	u_int ax = 0;
	u_int ay = 0;
	setColor(color);
	drawCircle(105 + x, 23 + y, 8);
	u_char i = 0;
	sx = ti1[i++] + x;
	sy = ti1[i++] + y;
	while (i < 10) {
		ax = ti1[i++] + x;
		ay = ti1[i++] + y;
		drawLine(sx, sy, ax, ay);
		sx = ax;
		sy = ay;
	}
	i = 0;
	sx = ti2[i++] + x;
	sy = ti2[i++] + y;
	while (i < 82) {
		ax = ti2[i++] + x;
		ay = ti2[i++] + y;
		drawLine(sx, sy, ax, ay);
		sx = ax;
		sy = ay;
	}
}

Share this post


Link to post
Share on other sites

I had to install the IAR IDE at home with the 30 day evaluation not kickstart to get it to work.

 

One last no0b/student question. If i wanted to generate a picture to display, how would i do that, kind of like how you have the TI logo, but i want to make it a real random picture.

 

Thanks a lot!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...