More Getting Started Kit Projects

Here are some more project ideas for you to to with your Getting Started Kit. We recommend you complete the tutorial first and then tackle the projects here.

True/False game

Create a list of true or false questions. Your program should ask a question, wait for the player to answer (green = true, red = false), provide feedback using the LEDs (correct = green vs incorrect = red), record a score (1 for correct, 0 for incorrect), then ask the next question. At the end of the game, your LEDs should flash 5 times and the score will be displayed.

Whack-A-Mole game

Create a program that randomly lights up an LED and waits for the corresponding button to be pushed.

  1. After the corresponding button has been pushed, turn off the LED and randomly activate one again.
  2. Time how long it takes players to hit the button. Create a final score from the times.
Record time (Java)

time.time() provides the time since your program started in seconds.

Not your programming language? Set your preferences so we can display relevant code examples

Record time (Python)

System.nanoTime() provides the time since your program started in nanoseconds. 1 nanosecond is 10^-9 seconds. To get the time in seconds use: (System.nanoTime * Math.pow(10,-9))

Not your programming language? Set your preferences so we can display relevant code examples

Record time (C#)
  1. add using System.diagnostics; at the top of your program
  2. Create a new stopwatch and start the timer just after your open call before you use your Phidgets:
    Stopwatch stopwatch = new Stopwatch();
    stopwatch.Start();
  3. stopwatch.ElapsedMilliseconds will provide you with the time since you started the timer in milliseconds. To convert to seconds use: (stopwatch.ElapsedMilliseconds/1000)

Not your programming language? Set your preferences so we can display relevant code examples

Record time (Swift)

To record the current time use: let time = Dispatch.now(). To use or print the time recorded in seconds use: time.uptimeNanoseconds/1000000000

Not your programming language? Set your preferences so we can display relevant code examples

Simon Says game

Make a simple Simon Says style game. The box should display a random sequence of LED flashes and the user should repeat this pattern by pressing the appropriate buttons.

  1. The sequence should begin at length one and increase in size by 1 every time the correct sequence is entered.
  2. If the sequence reaches a certain length, a message should appear on the console notifying the player that he or she has won.

Stopwatch

Create a program that allows you to start a timer, pause a timer and reset the timer. A green button press should start the timer. The red button press should pause the timer. If both buttons are pressed the timer should stop. When the timer is running the green LED should be on. When the timer is paused the Red LED should be on. When the timer is reset both LEDs should flash then turn off. For each button press, you should print the time in seconds to the user.

Record time (Java)

time.time() provides the time since your program started in seconds.

Not your programming language? Set your preferences so we can display relevant code examples

Record time (Python)

System.nanoTime() provides the time since your program started in nanoseconds. 1 nanosecond is 10^-9 seconds. To get the time in seconds use: (System.nanoTime * Math.pow(10,-9))

Not your programming language? Set your preferences so we can display relevant code examples

Record time (C#)
  1. add using System.diagnostics; at the top of your program
  2. Create a new stopwatch and start the timer just after your open call before you use your Phidgets:
    Stopwatch stopwatch = new Stopwatch();
    stopwatch.Start();
  3. stopwatch.ElapsedMilliseconds will provide you with the time since you started the timer in milliseconds. To convert to seconds use: (stopwatch.ElapsedMilliseconds/1000)

Not your programming language? Set your preferences so we can display relevant code examples

Record time (Swift)

To record the current time use: let time = Dispatch.now(). To use or print the time recorded in seconds use: time.uptimeNanoseconds/1000000000

Not your programming language? Set your preferences so we can display relevant code examples

Troubleshoot
  1. Make sure everything is plugged in properly and your VINT Hub is connected to your computer
  2. Check to make sure you are connected to the correct Hub Port on your VINT Hub. In this case your Red Button should be connected to Hub Port 0.
  3. Stop running other programs that are using your Phidgets before running a program.
  4. Check the button assembly. If the switch and button are not assembled correctly you will not see any button events. The plastic plunger should align with the activator as shown below.

If these do not solve your issue visit the Advanced Troubleshooting Page.

What are Phidgets?

Phidgets are programmable USB sensors. Simply plug in your sensor, write code in your favorite language and go!

Phidgets have been used by STEM professionals for over 20 years and are now available to students.

Learn more

Set your preferences

Windows

Mac OS

Raspberry Pi

Java

Python

C#

Swift

NetBeans

Processing

Eclipse

Thonny

PyCharm

PyScripter

Visual Studio

Xcode

Setting your preferred operating system, programming language and environment lets us display relevant code samples for the Getting Started Tutorial, Device Tutorials and Projects

Done