The Adafruit Crickit for Circuit Playground Express is an innovative robotics platform designed to bring life to your projects. It acts as an add-on to the Circuit Playground Express, enabling control over motors, servos, solenoids, and other electronic components. This versatile board is perfect for hobbyists, educators, and students looking to explore the world of robotics and interactive projects.
Pin Number | Function | Description |
---|---|---|
1 | GND | Ground |
2 | VOUT | Voltage output, connected to the power supply |
3-6 | Motor Outputs | Connect to DC motors or other inductive loads |
7-14 | Servo Outputs | Connect to up to 8 hobby servo motors |
A1-A7 | Analog Inputs | Analog sensor inputs |
D1-D7 | Digital I/O | Digital input/output pins |
SDA, SCL | I2C Data & Clock | I2C communication for sensors and other devices |
#include <Adafruit_Crickit.h>
// Create the Crickit object
Adafruit_Crickit crickit;
void setup() {
// Initialize the Crickit
crickit.begin();
// Set up a servo on channel 1
crickit.servo1.setMinMax(500, 2500); // Set the min and max pulse length
crickit.servo1.attach(1); // Attach servo on channel 1
}
void loop() {
// Sweep the servo from 0 to 180 degrees
for (int angle = 0; angle <= 180; angle++) {
crickit.servo1.write(angle);
delay(15);
}
// Sweep the servo back from 180 to 0 degrees
for (int angle = 180; angle >= 0; angle--) {
crickit.servo1.write(angle);
delay(15);
}
}
Note: The above code is an example of how to control a servo motor using the Adafruit Crickit with an Arduino UNO. Make sure to install the Adafruit Crickit library before uploading the code to your board.