Example Code

Wheel of Fortune with LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview

This application simulates the behaviour of the wheel of fortune.

 

Introduction 

Please try spinning the wheel of fortune. What will you win today?

This fun application allows the user to spin the wheel of fortune. Each time the application is run, the wheel will be spun with a random level of momentum.

The code utilises some bespoke maths to generate the random momentum and to reformat the image to allow for the rotation. The rotating wheel is displayed to the user via a picture control.

The picture's pivit point (point around which the wheel rotates) can be defined via a numeric cluster constant.

 

Requirements

  • LabVIEW 2012 SP1 (or compatible)

Steps  to implement

  • As the app uses relative file paths to point to the image of the wheel, please ensure that the files contained in the attached file are unziped to the same folder on disk.

 

Additional Information or References
Block Diagram

 

Wheel of fortune with LabVIEW - LV2012 NIVerified.PNG

 

 **This document has been updated to meet the current required format for the NI Code Exchange.**

Rich Roberts
Senior Marketing Engineer, National Instruments
Connect on LinkedIn: https://www.linkedin.com/in/richard-roberts-4176a27b/

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.