Library to program Circuit Playground Classic and Circuit Playground Express in C++ with the Arduino IDE.
On the Arduino IDE (v. 1.8.5+) use the Library Manager in order to install this library. Documentation can be found on the Adafruit's learning
This Readme is not as exhaustive as the example code or the official documentation that can be found here (CPX) and here (CPC). It is intended to be a reference where to find the listing of the library's functions at a glance.
-
Red LED
void redLED(boolean v)
-
Slide Switch
boolean slideSwitch(void)
-
Push Buttons
- Left :
boolean leftButton(void)
- Right :
boolean rightButton(void)
- Left :
-
Light Sensor
uint16_t lightSensor(void)
-
Neopixels
void clearPixels(void)
void setPixelColor(uint8_t p, uint32_t c)
void setPixelColor(uint8_t p, uint8_t r, uint8_t g, uint8_t b)
void setBrightness(uint16_t b)
uint32_t colorWheel(uint8_t x)
- Basic color detection:
void senseColor(uint8_t& red, uint8_t& green, uint8_t& blue)
uint32_t senseColor()
-
Capacitive touch
uint16_t readCap(uint8_t p, uint8_t samples=10)
-
Temperature sensor
- Celsius :
float temperature(void)
- Farenheit
float temperatureF(void)
- Celsius :
-
Microphone
uint16_t soundSensor(void)
-
Buzzer
void playTone(uint16_t freq, uint16_t time, boolean wait=true)
-
Accelerometer
float motionX(void)
float motionY(void)
float motionZ(void)
-
Infra Red [Circuit Playground Express only]
IR send and receive LEDs are used via theIRLib2
Library and are accessible via theirSend
andirReceiver
properties of theAdafruit_CircuitPlayground
class