Pages: [1]   Go Down
Author Topic: Routine to turn on single pixel on standard 16x2 lcd  (Read 744 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 5
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Where can I find a routine that turns on a single pixel on a standard hitachi 16x2 lcd?

something like this drawpixel(row,col)

I'd prefer not wasting time writing this API if its already been done.

Thanks! smiley
Logged

0
Offline Offline
Faraday Member
**
Karma: 16
Posts: 2857
ruggedcircuits.com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You probably can't. "Standard" 16x2 LCD's are character-based devices, not graphical devices. You send it characters and it draws 5x7 arrangements of pixels based upon the character you sent.

You can draw some custom characters yourself, up to 8 of them (I believe) and have them displayed. But there is no pixel-level control over the entire viewing area.

--
The Flexible MIDI Shield: MIDI IN/OUT, stacking headers, your choice of I/O pins
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 5
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This makes me very sad as I wanted to make a cute little pong game on my cute little 16x2 smiley-sad
Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 72
Posts: 7175
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

This makes me very sad as I wanted to make a cute little pong game on my cute little 16x2 smiley-sad
Could be done but with care redefining the 8 custom characters as needed.
Logged


Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 63
Posts: 2648
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This makes me very sad as I wanted to make a cute little pong game on my cute little 16x2 smiley-sad
Could be done but with care redefining the 8 custom characters as needed.

I definitely think that this could be done.
The odd part will be is that there is a horizontal gap between the 2 lines
on most displays.

If you think about it, you only need a maximum of 6 custom characters.
2 for each "paddle" and 2 for the ball. (only 1 for the ball if the ball is 1 pixel)

example:
0 and 1 are for the left paddle.
1 and 2 for the right paddle
3 (and 4 if more than 1 pixel) for the ball.


All you have to do is "draw" the pixels you need in the custom character
data for the custom characters with the pixels you need for each "frame" update.


For the updates,
You won't have to do anything for the paddles other than load the new custom
characters, as the new custom chars
will "magically" update/change the paddle characters/pixels as needed as soon
as the new custom characters are loaded.

For the ball, just use cursor positioning and write a <space> to the old position to
erase the "pixels" (custom char). Then update the new character position(s)
with the new custom char(s) to draw the new "pixels".

Sounds like a fun little project
Would be interesting to play against the "Arduino" .


--- bill
Logged

Offline Offline
Jr. Member
**
Karma: 1
Posts: 69
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have the same idea do you have a code and shematic
Logged

Pages: [1]   Go Up
Jump to: