Home

codesys.com Ingo
Attachments
Game-Preview.png (6867 bytes)
Pong-Schaltplan.PNG (83789 bytes)
Pong.PNG (89448 bytes)
There is a newer version of this page. You can find it here.

Tutorial for "Retro Games"

In this tutorial you will install a smal game (Pong) on your Raspberry Pi, which can be played with two physical controllers on a web-visualisation.

Things you need:

  • Computer with CODESYS Development System V3 with CODESYS Control for Raspberry Pi SL form the CODESYS-Store
  • every Raspberry Pi (CODESYS V3.5.11.0 or later). For more Information look at the description
    of CODESYS Control for Raspberry Pi SL in the CODESYS-Store.
  • 2x KY040 - Rotary Encoder
  • 10x jumper wire (maybe different colors)
  • LAN-Cable
  • Project files

Hardware:

  • Connect both KY040s to the Raspberry Pi as it is shown in the following images:


  • Insert the LAN-Cable to your Raspberry Pi and make sure that it is connected to
    lokal network. Now boot it by plugging in the powercable.

Software:

After opening CODESYS Development System V3 and adding the CODESYS Control for Raspberry Pi SL,
go to Tools -> Library Repository and Install the library, you have downloaded.

Go to Tools -> Update Raspberry Pi and scan in your network for Raspberry Pis and choose the correct one. Notice/copy the IP.

Now connect to your Raspberry Pi. Therefor double click on "Device" and choose on the new window your Raspberry Pi as your controller.

By pressing Alt + F8 you log in. Now start (F5).

Write in your Browser the IP-Adress and append :8080/webvisu.htm, now it should look like this: IP-ADRESS:8080/webvisu.htm

Game instructions:
Press on one KY040 to start the game. The player who reaches 14 points first wins.