Close

Adding an LCD to Laser Tag

A project log for Open Tag

The best game of laser tag you've never played. Choose your class - from a sniper to a pyro, and customize your own game of laser tag!

opentagopentag 08/27/2020 at 03:572 Comments

First of all, I'm very happy with how easy it is to connect an LCD to an arduino. I purchases an LCD, found a library on how to control it (I started with this tutorial, which was very informative about the chip they use for I2C communication to LCD's, and ended up using a different library, LiquidCrystal_I2C.h. It was very easy to install, and the example sketch got me up and running quickly.

Laser tag with LCD

And now, onto the gripes. 

First off, I want to be able to display health and any status effects so they are easily readable. If you have more than one status effect, I want you to be able to look down and read them all. With 16 characters per line, and two lines, I can't fit very many characters on the screen. I thought that it would be ok to shorten the words, like using e- for electricity or H2O for water, but it's not immediately apparent what you are looking at and what everything means. I'd like to make the text on the screen more self explanatory. That way, it will be easy for someone to look at the screen and know their status. 

Secondly, the screen is too wide. It's wider than the current board, and when you hold it it sticks out. I didn't like it, so I started looking at alternatives.

OLED's are another option for displays, and there are ones that also use I2C (which is great, because I don't have a lot of pins available to throw at this, especially if I'm adding radios/wifi later). I purchased a 0.96" OLED board and will try that one next. There are also good libraries on how to use that, from Adafruit (a company I love). 

Hopefully, with the OLED display, I will have more characters I can use (the text size is variable) and the screen will be smaller. Hopefully not too small. We'll see. the LCD that I had is a 16x2 (16 characters on two rows). Each character is 5 pixels wide and 8 pixels high. Or, the screen is about 80x16 pixels. The screen that I'm buying is 128x64 pixels (however, I think the pixels themselves are smaller), so, assuming the same number of pixels per character, I should be able to fit more characters per line, and have a lot more lines. The pixels and screen will be smaller, so I'll have to balance size with amount of information I need to show. Should be manageable. 

One last thing that I realized is that now that I have a display, I can start adding more features that require that you see how much health or mana you have. Instead of having unlimited use of your ability, I could have it on a recharge timer, or have a mana pool that is drained when you use the ability, and refills if you don't use it for 1 second. I think that would help the issue of holding down the flamethrower button forever or sending infinite healing. I think that would be fun, and I'll look into adding that into the next version of the code.

Discussions

ia.echo.hotel wrote 08/27/2020 at 04:26 point

Those 0.96" OLED screens are positively microscopic, probably meant for vape pens, possibly usable if you are intending to put it on a stiff wire arm in line of sight as a pseudo-HUD but not really suitable for reading past about a foot from your face, I speak from personal disappointment.

On another note, maybe ditch status names and go with icons or compromise and give players the option to highlight the icons for a name and scrolling description.

  Are you sure? yes | no

opentag wrote 08/29/2020 at 06:44 point

Yeah. I just got the 0.96" OLED screen in. And it's tiny.

I was thinking of putting it right behind the sight as a pseudo-HUD. You won't be holding the device more than an arm's distance away. And, in my experience, you hold it a bit closer to your face than an arm's length so you can aim down the sites. So, it ends up about a foot from your face. I tested it out and it works pretty good. It is a bit small holding it at arm's distance, and it may be hard to read for some people. But it's a start. May need to upgrade to a 2.7" display if it's really too small. First, I need to do some testing.

The icons are a great idea. I uploaded a bunch to the arduino and they look great. Thanks for that recommendation! I have a picture of the images on the next log post. Let me know what you think. 

  Are you sure? yes | no