Routine to turn on single pixel on standard 16x2 lcd

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! :slight_smile:

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

This makes me very sad as I wanted to make a cute little pong game on my cute little 16x2 :frowning:

fr4gg3r:
This makes me very sad as I wanted to make a cute little pong game on my cute little 16x2 :frowning:

Could be done but with care redefining the 8 custom characters as needed.

liudr:

fr4gg3r:
This makes me very sad as I wanted to make a cute little pong game on my cute little 16x2 :frowning:

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 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

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