Do you have a Raspberry Pi in your classroom that you'd love to use with Phidgets? Well, you're in luck! Keep reading to find out how to add some awesome functionality to your next Raspberry Pi project.
At the end of this project you will be able to connect and use a Phidget with a Raspberry Pi.
In order to use your Phidgets, you'll need to install libusb on the Raspberry Pi. The first step is to open the terminal:
Next, enter the following command:
Now that you have libusb installed, you will need to download the Phidget library for Linux.
Next, right-click libphidget22 and select Extract To...
Change the extract location to /home/pi/ and click Extract.
Navigate to /home/pi/ where you will now find the libphidget22 folder. Right-click on the libphidget22 folder and select Open in Terminal.
Enter the following command in the terminal:
Followed with the make command (this may take some time to complete):
Next, restart your terminal (or open a new one) and update the library cache.
In your libphidget22 folder, navigate to /plat/linus/udev. Right click on the udev folder and select Open in Terminal.
In order to allow your programs to access the phidgets connected to your Raspberry Pi, you
need to configure the device rules.
You can do this by entering the following command:
Note: be sure to replace libphidget22-1.4.20190605 with your library version. Use the TAB key to autocomplete.
Navigate to /etc/udev. You should now find a folder titled rules.d containing 2 files.
Now that everything is set up properly, be sure to reboot!
Your Raspberry Pi is now set up (a one time process). Next, you can start using your Phidgets.
Open Thonny Python IDE.
Switch to regular mode.
Select Tools> Manage Packages.
Find the Phidget22 package and click install.
create a file called test.py and add the following code to run the redLED on your Getting Started Kit.
With that, you are ready to start integrating Phidgets into your Raspberry Pi projects!
Make a cool project using Raspberry Pi and Phidgets? We'd love to hear about it at firstname.lastname@example.org