Package: inventorhatmini
Inventor HAT MiniA versatile motor, servo and audio driver HAT for Raspberry Pi. Bring your mechanical inventions, creations and contraptions to life!Buy it from:https://shop.pimoroni.com/products/inventor-hat-miniGetting the LibraryStable library only (no examples) from PyPi:Just runsudo python3 -m pip install inventorhatminiThis will install the library under the root user. This is required to use Inventor HAT Mini's RGB LEDs, which rely on therpi_ws281x package.In some cases you may need to install pip with:sudo apt install python3-pipStable library, with latest examples from GitHub:git clone https://github.com/pimoroni/inventorhatmini-pythoncd inventorhatmini-python./install.shLatest/development library and examples from GitHub:git clone https://github.com/pimoroni/inventorhatmini-pythoncd inventorhatmini-python./install.sh --unstableConfiguring your Raspberry PiEnable I2CIn order to use the motor, servo, and IO features of Inventor HAT Mini, you need to enable the I2C interface of your Raspberry Pi. This can be done in the terminal by running:sudo raspi-config nonint do_i2c 0Alternatively, you can enable the I2C interface by:runningsudo raspi-configand enabling the option underInterfacing Options.opening the graphicalRaspberry Pi Configurationapplication from thePreferencesmenu.You may need to reboot after enabling I2C for the change to take effect.Increase I2C BaudrateTo get the most out of your Inventor HAT Mini it is recommended to run your Raspberry Pi with a higher I2C baudrate than the default 100KHz. This can be done by modifying your Pi's configuration file. To do this runsudo nano /boot/config.txtto open a terminal text editor.Within the editor navigate to the linedtparam=i2c_arm=on. If this saysoffor is commented out with a#, use this opportunity to change it. Now insert the following line below it,dtparam=i2c_baudrate=400000to increase the baudrate.When you are finished modifying the file, pressCTRL+Xon your keyboard, then when asked toSave modified buffer?pressY.Reboot after this for the change to take effect.Enable AudioTo use the audio output of your Inventor HAT Mini you will need to modifying your Pi's configuration file. To do this runsudo nano /boot/config.txtto open a terminal text editor.Within the editor navigate to the bottom of the file and include the linesdtoverlay=hifiberry-dacandgpio=25=op,dh. The first line switches the audio to use the GPIO header of your Pi for audio output, and the second line will cause your Pi to enable the audio output on bootup, by setting pin BCM 25 to high. Then navigate up to the linedtparam=i2s=on. If this saysoffor is commented out with a#, uncomment it and change it toon.Depending on your setup, you may also need to disable other audio outputs of your Pi (for example audio over HDMI). Look through the file for any existing mention todtparam=audio=onand change it todtparam=audio=off. There may the linedtoverlay=vc4-kms-v3d. Modify this to bedtoverlay=vc4-kms-v3d,noaudio.When you are finished modifying the file, pressCTRL+Xon your keyboard, then when asked toSave modified buffer?pressY.Reboot after this for the change to take effect.Examples and UsageThere are many examples to get you started with your Inventor HAT Mini. With the library installed on your Raspberry Pi, these can be found in the~/Pimoroni/inventorhatmini/examplesdirectory. Details about what each one does can be found in theexamples readme.To take Inventor HAT Mini further, the full API is described in thelibrary reference.Removing the LibraryTo uninstall the library only (keeping all examples):Just runsudo python3 -m pip uninstall inventorhatminiOr if you have grabbed the library from Github:cd inventorhatmini-python./uninstall.sh0.0.1Initial Release