loading
Code: http://bit.ly/lcdtrucks
I was fooling around with the createChar() function to create cars.
How Sinclair ZX Spectrum :) Cars are small, so it's better to view them in full screen mode.
I'm using an Electronic Brick display (long story), but any Hitachi HD44780 compatible would do.
<p>hi, there. It's such an interesting game. Would you mind if I add it to my tutorial as an example?</p>
<p>Hi.</p><p>If what you're doing is not commercial, all you need to do is give me credit by linking <a href="https://www.instructables.com/id/Truck-Lane-a-16x2-LCD-Arduino-game/" rel="nofollow">here</a> and to the <a href="https://www.instructables.com/static/entry/license/BY_NC_SA.html" rel="nofollow">license</a>. If it's commercial - I'd like to know more ;)</p><p>Anyway, note that &quot;Truck Lane&quot; is not a full instructable (e.g. there are no schematics). Perhaps <a href="https://www.instructables.com/id/Ariadne-a-1st-person-maze-on-a-16x2-LCD/" rel="nofollow">Ariadne</a> and/or <a href="https://www.instructables.com/id/Marble-Disorder-a-marble-maze-simulator-with-til/" rel="nofollow">Marble Disorder</a> are more suitable for a tutorial.</p><p>Once your tutorial is ready, please send me a link.</p><p>All the best,</p><p>The Dod.</p>
<p>It was so cool!</p>
<p>It was so cool!</p>
<p>It was so cool!</p>
<p>Great Arduino game. Oh I connected a 10k potentiometer to A1 and my 16x2 display is connected to my uno using IIC/I2C/TWI/SPI Serial Interface on pin 4 and 5. Works great. Beside resetting the unit, how to restart game.</p><p>you need to do these changes to use the serial interface</p><p>remove</p><p>#include &lt;LiquidCrystal.h&gt;</p><p>LiquidCrystal lcd(2, 3, 4, 5, 6, 7, 8);</p><p></p><p>add</p><p>#include &lt;Wire.h&gt; <br>#include &lt;LiquidCrystal_I2C.h&gt; //need to downed if you don't have it</p><p>LiquidCrystal_I2C lcd(0x27,16,2);</p><p>change</p><p>const int POTPIN = 1;</p><p>to</p><p>const int POTPIN = A1;</p><p>in void setup()</p><p>add</p><p>lcd.init(); // initialize the lcd <br> lcd.backlight(); //add this if you want backlight</p><p>in all I used 8 wires for this game. I not sure can I use a 0.5 watt 8 ohm speaker for a Piezo speaker so I left that out.</p><p>Works great</p>
<p>Great Arduino game.</p>
<p>What other pin setups can use. I have a joy stick sheild by sparkfun. <a href="https://www.sparkfun.com/tutorials/171" rel="nofollow">https://www.sparkfun.com/tutorials/171 </a> and it needs a lot of pins. I have 13 to 7 open and A2 to A5 open. I cant seem to make it run the program, I changed &quot;LiquidCrystal lcd(12, 11, 5, 4, 3, 2);&quot;to&quot; LiquidCrystal lcd(12,11,10,9,8,7). any ideas??</p>
<p>The type of lcd display does not really matter does it?</p>
Can you provide the circuit diagram pleaase??? <br>
It's quite similar to the one at Ariadne: https://www.instructables.com/id/Ariadne-a-1st-person-maze-on-a-16x2-LCD/#step1 <br>The only differences is that Ariadne also has a push button. <br>Ariadne also comes with a pde file (Truck Lane also had one, but I guess I've lost it :) ), and is much more fun to play.
nice work, how can i do a similar job on a pic18f4550 , using a 128 x64 lcd.
Thanks.<br>Re pic: I've never tried working on anything less user-friendly than an Arduino. I'm a coder, not a warrior :) but it shouldn't be hard.<br>As for 128x64 LCD: when you have real pixel-level graphics [IMHO] you don't need to resort to font glyphs.<br>Trying to imitate truck lane would be aiming too low when you can place the obstacles (trucks, trees, etc.) on a grid of 64 instead of 5. You can easiily do a ski game with trees (maybe a few moving skiers). Looks more impressive and is a lot more fun to play.
yes the ski game sounds cool, but whats crazy is how you made a scrolling game on an small lcd. anyway, i'm attempting snake at the moment but i dont know if the ski game your mentioned would be easier to implement on my system. i can move pixels and shapes on screen successfully . i just need the algorithm for moving objects and detecting collisions as you've done in your game.
it's great

About This Instructable

16,281views

12favorites

License:

Bio: Sucks at soldering, compensates with coding. Twitter: @TheRealDod Twister/github/etc.: @TheDod Diaspora: thedod@diasp.de
More by thedod:Cheap solderless reset button for Raspberry Pi Make Seedstudio's I2C LCD monitor work with an old Arduino Thermoscope - 16x2 LCD thermometer with S/M/H graphs 
Add instructable to: