LabVIEW Interface for Arduino Documents

cancel
Showing results for 
Search instead for 
Did you mean: 

Ball and Paddle Game (LabVIEW Pong)

For this VI, an Arduino and a thumbstick are needed.

Description:

This VI uses a thumbstick and the Arduino to play a ball and paddle game.

Tutorial:

  1. Make sure you have installed the LabVIEW Interface for Arduino.
  2. Open the Arduino Thumbstick Game LabVIEW project
  3. On the front panel, select the COM port that the Arduino is associated with on the "Select Visa Resource" drop down menu
  4. Select the difficulty, the harder difficulty makes the paddle smaller.
  5. Select the number of balls (1-3)
    • Note: if ANY of the balls drop below the paddle, the game ends.
  6. Click Run.
  7. See if you can beat all of your friends' high scores

Game.PNG

Block Diagram.PNG

Notes and Tips

  • The block diagram is fairly large, so it is not fully shown.
  • Each of the 3 balls have a slightly different starting speed.
  • When the ball hits the paddle, a small, random horizontal speed is added to the ball towards the right, which could increase or decrease the actual speed of the ball.
  • If you want to adjust the speed horizontal or vertical relative to each other or relative to the other balls, adjust the speed going into the initialize VI.
  • If you want to adjust the speed of the game, adjust the speed of the loop.
  • If the balls are not in play, they still appear in the upper left corner of the game.

Update (V 1.2)

popup.PNG

  • The name popup contains the controls to determine gameplay experience
  • You don't need an arduino connected, although it is highly recommended
    • Arrow keys move paddle side to side, but cannot be held down
  • High Scores popup at end
  • If the balls are not in play, they are invisible
  • The ball reacts to where on the paddle it is hit
    • Magnitude of reaction is random
  • Pause when either the space bar or P is pressed
  • Is built into an application

Update (V 2.0)

Screenshot.PNG

ScreenshotCode.PNG

  • Transitioned from LIFA to LINX
  • Updated UI
  • Refactored code for efficiency and readability
  • Added sweet Icon for built application
  • Updated to LabVIEW 2015
Comments
Kristoff2
NI Employee (retired)
on

Nice work Jason.  Sony, Nintendo and Microsoft better watch out.  LV and Arduino are taking over!

-Sam

LIFA Developer

Contributors