Explorer HAT Pro adds a lot of useful tools to your Raspberry Pi. It has digital inputs and outputs, capacitive touch pads, croc. clip compatible pads, coloured LEDs, analog inputs, motor drivers, and a mini breadboard for prototyping your projects.
The following section will provide a brief overview of the various components of the Explorer HAT along with some sampe code to get your activities started. Be sure to install the ExplorerHAT Python Library before moving forward.
The first step to working with the RPi Explorer HAT to to import its Python Library at the beginning of each program. This is a simple line of code: import explorerhat Once it has been imported, you can call on the library's syntax to program. However, you will be required to specifically all on explorerhat in a lot of your program. You may choose to rename the HAT by modifying your library import to read (i.e.) import explorerhat as TK
The Explorer HAT hardware has dedicated female pin slots for wiring two motors. Many projects can use the rotation generated from motors, from a gameshow wheel to a simple robot. To prepare for the Python Explorer HAT program, hardwire a motor using Motor 1 according to the following diagram.
Use the following Python code as an introduction.
A function is an independent and reusable block of code which you can call any number of times from any place in a program. It is an essential tool for programmers to split a big project into smaller modules.
In Python, a function is a logical unit of code containing a sequence of statements indented under a name given using the “def” keyword. Functions allow you to create a logical division of a big project into smaller modules. They make your code more manageable and extensible. While programming, it prevents you from adding duplicate code and promotes reusability.
The kit is a great way to introduce yourself to robots and controlling motors with your Raspberry Pi. It even includes a camera mount so your little robot can take pictures while it's roaming around! There is no soldering required and the whole kit can be put together with a small flat-head screwdriver.