Skip to content

hellcatlemai/Adafruit-Raspberry-Pi-Python-Code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Repository files navigation

Adafruit's Legacy Raspberry Pi Python Code Library

What happened to all the Raspberry Pi Python code!?

In the past this repository held all of the Raspberry Pi related Python code that Adafruit published. For example code to talk to sensors like the BMP085, TCS34725, and other hardware like character LCD plates. Over time we found it difficult to manage so much code in a single repository, and couldn't easily put the code on Python's package index for simple installation. Now we've broken out all of the previous Python code into individual GitHub repositories, and we've loaded all of these repositories on the Python package index so they can be installed with pip (note that pip won't install example code so for most users it's recommended to install from source).

In addition all of the Python libraries below support both Python 2.7 and Python 3.x! Note if you do plan to use Python 3 it has totally separate libraries from Python 2 so you might need to install all the libraries you use in both Python 2 and 3. See this video stream for more details: https://www.youtube.com/watch?v=rRFG32EebNc In particular on a Raspberry Pi you probably want to install Python 3, PIP for Python 3, and the RPi.GPIO library (used to talk to GPIO pins on the Pi) with these commands:

sudo apt-get update sudo apt-get install -y python3 python3-pip python-dev sudo pip3 install rpi.gpio 

Where do I find the new Raspberry Pi Python code?

Here is a table with each of the old libraries and a link to their new unique GitHub repositories and easy pip install names:

Old Library NameNew Library LocationNew pip install Package NameNotes
Adafruit_ADS1x15https://github.com/adafruit/Adafruit_Python_ADS1X15adafruit-ads1x15See guide.
Adafruit_ADXL345https://github.com/adafruit/Adafruit_Python_ADXL345adafriut-adxl345-
Adafruit_BMP085https://github.com/adafruit/Adafruit_Python_BMPadafruit-bmpSee guide.
Adafruit_CharLCDhttps://github.com/adafruit/Adafruit_Python_CharLCDadafruit-charlcdSee new character LCD guide.
Adafruit_CharLCDPlatehttps://github.com/adafruit/Adafruit_Python_CharLCDadafruit-charlcdSee new character LCD guide.
Adafruit_DHT_Driverhttps://github.com/adafruit/Adafruit_Python_DHTNone, must be manually installed to properly compile C extension.See the C code for reading the DHT sensor in the updated Python driver.
Adafruit_DHT_Driver_Pythonhttps://github.com/adafruit/Adafruit_Python_DHTNone, must be manually installed to properly compile C extension.See updated DHT sensor guide
Adafruit_I2Chttps://github.com/adafruit/Adafruit_Python_GPIOadafruit-gpioSee updated I2C code in the Python GPIO library. Import with import Adafruit_GPIO.I2C as I2C and create an instance of I2C.Device instead of the old Adafruit_I2C class.
Adafruit_LEDBackpackhttps://github.com/adafruit/Adafruit_Python_LED_Backpackadafruit-led-backpackSee new LED backpacks guide.
Adafruit_LEDpixelshttps://github.com/adafruit/Adafruit_Python_WS2801adafruit-ws2801-
Adafruit_LSM303https://github.com/adafruit/Adafruit_Python_LSM303adafruit-lsm303-
Adafruit_MCP230xxhttps://github.com/adafruit/Adafruit_Python_GPIOadafruit-gpioSee updated MCP230xx code.
Adafruit_MCP3002Deprecated, see MCP3008 chip.--
Adafruit_MCP3008https://github.com/adafruit/Adafruit_Python_MCP3008adafruit-mcp3008See guide.
Adafruit_MCP4725https://github.com/adafruit/Adafruit_Python_MCP4725adafruit-mcp4725See guide
Adafruit_PWM_Servo_Driverhttps://github.com/adafruit/Adafruit_Python_PCA9685adafruit-pca9685See guide
Adafruit_TCS34725https://github.com/adafruit/Adafruit_Python_TCS34725adafruit-tcs34725-
Adafruit_VCNL4000https://github.com/adafruit/Adafruit_Python_VCNL40xxadafruit-vcnl40xx-

You might also be interested in other Python libraries which were never in this repository but are handy for talking to other hardware:

Device / GuideLibrary Locationpip install Package Name
BME280 Humidity & Pressure Sensorhttps://github.com/adafruit/Adafruit_Python_BME280TBD
BNO055 Absolute Orientation Sensorhttps://github.com/adafruit/Adafruit_Python_BNO055adafruit-bno055
ILI9341 LCD Displayshttps://github.com/adafruit/Adafruit_Python_ILI9341adafruit-ili9341
MAX31855 Thermocouple Sensorhttps://github.com/adafruit/Adafruit_Python_MAX31855adafruit-max31855
MAX9744 Class D Amplifierhttps://github.com/adafruit/Adafruit_Python_MAX9744adafruit-max9744
MCP9808 Temperature Sensorhttps://github.com/adafruit/Adafruit_Python_MCP9808adafruit-mcp9808
PN532 NFC Interfacehttps://github.com/adafruit/Adafruit_Python_PN532adafruit-pn532
SSD1306 OLED Displayshttps://github.com/adafruit/Adafruit_Python_SSD1306adafruit-ssd1306
TMP006 & TMP007 Temperature Sensorshttps://github.com/adafruit/Adafruit_Python_TMPadafruit-tmp

But I need the old code! What can I do?

Don't worry the old Adafruit Raspberry-Pi Python code can be found in the legacy branch of this repository. This is a snapshot of the old code before it was refactored into individual libraries. Note this legacy code will not be maintained!

About

Adafruit library code for Raspberry Pi

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published