The Adafruit Crickit HAT for Raspberry Pi is an innovative robotics extension board that transforms your Raspberry Pi into a powerful platform for hardware hacking and robotic control. This HAT (Hardware Attached on Top) is designed to work seamlessly with the Raspberry Pi, providing an easy-to-use interface for driving a wide range of actuators including motors, servos, and solenoids, as well as interfacing with sensors and other electronic components.
Pin Number | Function | Description |
---|---|---|
1 | 3V3 | 3.3V power supply |
2 | 5V | 5V power supply from Raspberry Pi |
3 | SDA | I2C Data line for communication with Raspberry Pi |
4 | 5V | 5V power supply |
5 | SCL | I2C Clock line for communication with Raspberry Pi |
6 | GND | Ground |
... | ... | ... |
40 | GPIO21 | General Purpose Input/Output (used for additional I/O) |
Note: This table only includes a subset of the pins for brevity.
raspi-config
.i2cdetect
command to confirm that the Raspberry Pi recognizes the Crickit HAT.Q: Can I power the Crickit HAT separately from the Raspberry Pi? A: Yes, you can use an external power source for the Crickit HAT, but ensure it is within the recommended voltage range.
Q: How many motors can I control with the Crickit HAT? A: The Crickit HAT can control up to 4 servos, 2 DC motors, and 1 stepper motor simultaneously.
Q: Is the Crickit HAT stackable? A: No, the Crickit HAT is not designed to be stackable due to the high current requirements of motors and actuators.
Below is an example Python script to control a servo motor connected to the Crickit HAT using an Arduino UNO:
import time
from adafruit_crickit import crickit
servo = crickit.servo_1
while True: for angle in range(0, 180, 5): # Move in 5 degree increments servo.angle = angle time.sleep(0.05) for angle in range(180, 0, -5): # Move back in 5 degree increments servo.angle = angle time.sleep(0.05)
Remember to install the `adafruit-crickit` library before running the script. This can be done using the following command:
```shell
pip3 install adafruit-crickit
Ensure that the servo is connected to the correct servo port on the Crickit HAT and that the Raspberry Pi has the I2C interface enabled.