Raspberry Pi and Python: Difference between revisions
(Created page with "Category: Project {{TOC limit|3}} {{#seo:|description=Learn how to use Phidgets with the Raspberry Pi and Python.}} 400px|link=https://www.phidgets.com/docs/images/5/5a/Pi_2023.jpg|thumb|<center>Raspberry Pi 4</center> ==Introduction== With Phidgets, you can easily extend the functionality of your Raspberry Pi. Follow the steps below to get your first Python program running on your Pi! <br><br><br><br><br> ==Install the Phidget Libraries== If yo...") |
No edit summary |
||
Line 1: | Line 1: | ||
[[Category: Project]] | [[Category: Project]] | ||
{{TOC limit|3}} | {{TOC limit|3}} | ||
{{#seo:|keywords=raspberry pi}} | |||
{{#seo:|description=Learn how to use Phidgets with the Raspberry Pi and Python.}} | {{#seo:|description=Learn how to use Phidgets with the Raspberry Pi and Python.}} | ||
[[Image:Pi_2023.jpg|400px|link=https://www.phidgets.com/docs/images/5/5a/Pi_2023.jpg|thumb|<center>Raspberry Pi 4</center>]] | [[Image:Pi_2023.jpg|400px|link=https://www.phidgets.com/docs/images/5/5a/Pi_2023.jpg|thumb|<center>Raspberry Pi 4</center>]] |
Latest revision as of 17:19, 26 June 2023
Introduction
With Phidgets, you can easily extend the functionality of your Raspberry Pi. Follow the steps below to get your first Python program running on your Pi!
Install the Phidget Libraries
If you are using a Raspberry Pi model 2 or above, you can simply enter the following command into the terminal to install the Phidget libraries:
curl -fsSL https://www.phidgets.com/downloads/setup_linux | bash - &&\
apt-get install -y libphidget22
curl -fsSL https://www.phidgets.com/downloads/setup_linux | sudo -E bash - &&\
sudo apt-get install -y libphidget22
Your terminal will look something like this:
If you are using an older version of the Raspberry Pi, visit our Linux page and view the Source Install instructions.
Install the Phidget Python Module
Now that the libraries (drivers) are installed, the Phidget Python Modules can be installed. You can do this from a specific development environment, like Thonny (bundled with Raspberry Pi OS), or you can install it system-wide through the terminal.
Open the terminal and enter the following command:
pip3 install Phidget22
Start by opening Thonny.
Thonny defaults to a simple mode on the Raspberry Pi. Click on Switch to regular mode if you have not previously.
Next, select Tools > Manage Packages.
Finally, search for Phidget22 and press Install.
Run Your Python Program
Now that the Phidget libraries and Python module are installed, you can begin developing against your Phidgets on the Raspberry Pi with Python!