Arduino Esplora Pong

Want to play Pong on your computer with your Esplora? This example shows you how.

This example is designed to be used with a Processing sketch. Processing is an open source programming environment. The Esplora reads the slider and buttons and sends data to the Processing sketch serially over USB, and Processing uses the incoming data to move paddles in a game of Pong.

If you don’t have Processing installed on your computer, download it from the Processing site and follow the installation instructions.

Download the zip file containing the Processing sketch for this example.

You only need to unzip this folder inside your Processing sketches folder, and open the .pde file in Processing.

Software Required

Circuit

Only your Arduino Esplora is needed for this example.

Arduino Esplora Pong circuit

Esplora board using slider and pushbuttons

Code

This example sends the states of the slider and three pushbuttons serially to the computer. The associated Processing sketch reads the serial data to control the paddles and the state of the game.

The data is always sent in the same order: slider, button 1, button 3, button 4. The data are separated by commas. The Serial.println() command that sends the final button also sends a newline character. The Processing sketch looks for the newline to know when it’s got all the sensor data.

Major Components in Project

Hardware Required

  • Arduino Esplora

For more detail: Arduino Esplora Pong


A Propos De L'Auteur

Ibrar Ayyub

Je suis expérimenté, rédacteur technique, titulaire d'une Maîtrise en informatique de BZU Multan, Pakistan à l'Université. Avec un arrière-plan couvrant diverses industries, notamment en matière de domotique et de l'ingénierie, j'ai perfectionné mes compétences dans la rédaction claire et concise du contenu. Compétent en tirant parti de l'infographie et des diagrammes, je m'efforce de simplifier des concepts complexes pour les lecteurs. Ma force réside dans une recherche approfondie et de présenter l'information de façon structurée et logique format.

Suivez-Nous:
LinkedinTwitter

Laisser un Commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

fr_FRFrench
Faire défiler vers le Haut