Playing Pong on Arduino Console or Any Other Machine!

by fabioNMI in Circuits > Software

202 Views, 4 Favorites, 0 Comments

Playing Pong on Arduino Console or Any Other Machine!

pong.png

This code shows how to implement a very little game on a console terminal using an ANSI terminal library and that can run on any machine from an Arduino to a laptop or any other embedded system with a console interface.

Supplies

Any Arduino board (or your Linux laptop or Windows laptop with MinGW, WSL or equivalent)

USB cable for programming the Arduino and connecting to a computer

FancyTerminal Library

ArduinoLibrary.png
pongIDE.png

Add the FancyTerminal library (make sure you have the latest version!)

Select the builtin example pong (there is also a human-machine interface demo if you are interested)

Upload and Enjoy!

006 - Fancy terminal on Linux and Arduino!

You can use almost any terminal emulator program as long as it is compatible with ANSI escape codes (VT100 and alikes should work just fine). Set the port to match your Arduino and the speed is 115200bps.

On Linux you can use minicom but I prefer screen: on Arduino Uno which usually enumerates as ttyUSB0, the command

screen /dev/ttyUSB0 115220

Should bring up the Arduino console right away!

Don't forget that the sequence for closing a screen session is CTRL + A K

Enjoy!

If you are interested in contributing or using the library elsewhere, clone the repository from github: https://github.com/FabioNMI/fancyTerminal