Python is a popular programming language, written on top of C. Its syntax allows programmers to write in fewer lines of code, and is easy for new programmers to learn.
Documentation and Installation
Documentation for the Python Hummingbird library can be found here.
Once Python is installed on your computer, follow our instructions for compiling and running programs..
Important Files and Folders
The following files and folders are common to all Hummingbird Python downloads:
hummingbird.py - The Hummingbird API source file.
hummingbirdconnection.py - Contains low level functions for sending and receiving data over USB, used by hummingbird.py
hidapi32/64.dll (Windows), libhidapi.dylib (Mac), libhidapi32/64.so (Linux) - Compiled C libraries used by hummingbirdconnection.py to scan for USB devices (specifically, the Hummingbird) and open a connection. dll files are for Windows, dylib is for OSX, and so is for Linux.
Various example programs written in python using pyhumm.py:
- cricketexample.py - Chirps with vibration motor based on the temperature
- driverexample.py - Spins the motors, speed depending on how far an object is from the distance sensor
- LEDexample.py - Adjusts the brightness of the LEDs depending on background sound levels
- hummingbirdTester.py - Tests all of the hummingbird API functions.
The Hummingbird Python library has been tested on Windows XP 32-bit Windows 7/8 64-bit, Mac OS 10.6, and Ubuntu 12.04 with Python 2.6, 2.7, and 3.3.
We have not included 32-bit support for Mac.
We do not support XP 64-bit, but you can use the library on 64-bit XP so long as you install a 32-bit version of Python.
On a Mac, you must search for the libhidapi64.dylib and libhidapi32.dylib libraries and copy them into the Mac's /usr/local/lib directory. To find this directory, select Go/Go to Folder in the Finder. If the directory does not exist, you can create it in Terminal with the following command: sudo mkdir /usr/local/lib