Now that you've completed the Getting Started kit and have a basic understanding of programming with Phidgets, you can easily integrate sensors into your Processing projects.
This project assumes you have an understanding of Processing and have completed the Getting Started Kit.
For more information, check out the Student Page.
You will need:
- A Getting Started Kit
Connect your Getting Started Kit to your computer.
Verify that Phidget libraries were added to your sketch by navigating to the location of your sketch. There will be a new folder called code:
Inside the code folder there will be a copy of phidget22.jar:
Now that you've added the Phidget Libraries to your Processing project, you can start coding.
Next, define a DigitalInput object, and then create and address it in your setup() method. Don't forget about error handling!
- Define a boolean called buttonPresed.
- Add a state change listener for your DigitalInput object before the open call.
- Check if the button's been pressed, and update the buttonPressed variable.
Next, modify your draw() method to check the state of the boolean variable. Modify your window's background color based on the state.
Now that you know how to use Phidgets with Processing, try creating your own project with the Phidgets in your classroom. If you need inspiration, check out the links below: