diff --git a/.github/workflows/arduino_cron.yml b/.github/workflows/arduino_cron.yml index 401816f1a..497c7c91c 100644 --- a/.github/workflows/arduino_cron.yml +++ b/.github/workflows/arduino_cron.yml @@ -97,6 +97,8 @@ jobs: git clone --quiet https://github.com/adafruit/HID /home/runner/Arduino/libraries/HID_Project rm -rf /home/runner/Arduino/libraries/ArduinoHttpClient git clone --quiet https://github.com/arduino-libraries/ArduinoHttpClient.git /home/runner/Arduino/libraries/ArduinoHttpClient + git clone --quiet https://github.com/pschatzmann/ESP32-A2DP /home/runner/Arduino/libraries/ESP32-A2DP + git clone --quiet https://github.com/pschatzmann/arduino-audio-tools /home/runner/Arduino/libraries/arduino-audio-tools - name: test platforms run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} diff --git a/Adafruit_DRV8833/arduino/drv8833_onoff/.uno.test.only b/Adafruit_DRV8833/arduino/drv8833_onoff/.uno.test.only new file mode 100644 index 000000000..e69de29bb diff --git a/Adafruit_DRV8833/arduino/drv8833_onoff/drv8833_onoff.ino b/Adafruit_DRV8833/arduino/drv8833_onoff/drv8833_onoff.ino new file mode 100644 index 000000000..b95db1801 --- /dev/null +++ b/Adafruit_DRV8833/arduino/drv8833_onoff/drv8833_onoff.ino @@ -0,0 +1,40 @@ +// SPDX-FileCopyrightText: 2025 Carter Nelson for Adafruit Industries +// +// SPDX-License-Identifier: MIT + +// Basic ON/OFF control of DC motor via DRV8833 + +#define AIN1 5 +#define AIN2 6 +#define SLP 7 + +void setup() { + Serial.begin(115200); + Serial.println("Adafruit DRV8833 DC Motor Example - ON/OFF"); + + // configure pins + pinMode(AIN1, OUTPUT); + pinMode(AIN2, OUTPUT); + pinMode(SLP, OUTPUT); + + // enable DRV8833 + digitalWrite(SLP, HIGH); +} + +void loop() { + // + // FORWARD + // + Serial.println("Forward"); + digitalWrite(AIN1, HIGH); + digitalWrite(AIN2, LOW); + delay(1000); + + // + // REVERSE + // + Serial.println("Reverse"); + digitalWrite(AIN1, LOW); + digitalWrite(AIN2, HIGH); + delay(1000); +} diff --git a/Adafruit_DRV8833/arduino/drv8833_pwm/.uno.test.only b/Adafruit_DRV8833/arduino/drv8833_pwm/.uno.test.only new file mode 100644 index 000000000..e69de29bb diff --git a/Adafruit_DRV8833/arduino/drv8833_pwm/drv8833_pwm.ino b/Adafruit_DRV8833/arduino/drv8833_pwm/drv8833_pwm.ino new file mode 100644 index 000000000..163888dca --- /dev/null +++ b/Adafruit_DRV8833/arduino/drv8833_pwm/drv8833_pwm.ino @@ -0,0 +1,60 @@ +// SPDX-FileCopyrightText: 2025 Carter Nelson for Adafruit Industries +// +// SPDX-License-Identifier: MIT + +// PWM speed control of DC motor via DRV8833 + +#define AIN1 5 +#define AIN2 6 +#define SLP 7 + +void setup() { + Serial.begin(115200); + Serial.println("Adafruit DRV8833 DC Motor Example - PWM"); + + // configure pins + pinMode(AIN1, OUTPUT); + pinMode(AIN2, OUTPUT); + pinMode(SLP, OUTPUT); + + // enable DRV8833 + digitalWrite(SLP, HIGH); +} + +void loop() { + // + // FORWARD + // + Serial.println("Forward"); + digitalWrite(AIN2, LOW); + // ramp speed up + Serial.println(" ramping up"); + for (int duty_cycle=0; duty_cycle<256; duty_cycle++) { + analogWrite(AIN1, duty_cycle); + delay(10); + } + // ramp speed down + Serial.println(" ramping down"); + for (int duty_cycle=255; duty_cycle>=0; duty_cycle--) { + analogWrite(AIN1, duty_cycle); + delay(10); + } + + // + // REVERSE + // + Serial.println("Reverse"); + digitalWrite(AIN1, LOW); + // ramp speed up + Serial.println(" ramping up"); + for (int duty_cycle=0; duty_cycle<256; duty_cycle++) { + analogWrite(AIN2, duty_cycle); + delay(10); + } + // ramp speed down + Serial.println(" ramping down"); + for (int duty_cycle=255; duty_cycle>=0; duty_cycle--) { + analogWrite(AIN2, duty_cycle); + delay(10); + } +} diff --git a/Adafruit_DRV8833/arduino/drv8833_stepper/.uno.test.only b/Adafruit_DRV8833/arduino/drv8833_stepper/.uno.test.only new file mode 100644 index 000000000..e69de29bb diff --git a/Adafruit_DRV8833/arduino/drv8833_stepper/drv8833_stepper.ino b/Adafruit_DRV8833/arduino/drv8833_stepper/drv8833_stepper.ino new file mode 100644 index 000000000..572e33cd1 --- /dev/null +++ b/Adafruit_DRV8833/arduino/drv8833_stepper/drv8833_stepper.ino @@ -0,0 +1,30 @@ +// SPDX-FileCopyrightText: 2025 lady ada for Adafruit Industries +// +// SPDX-License-Identifier: MIT + +#include + +// change this to the number of steps on your motor +#define STEPS 200 + +// create an instance of the stepper class, specifying +// the number of steps of the motor and the pins it's +// attached to +Stepper stepper(STEPS, 4, 5, 6, 7); + + +void setup() +{ + Serial.begin(9600); + Serial.println("Stepper test!"); + // set the speed of the motor to 30 RPMs + stepper.setSpeed(60); +} + +void loop() +{ + Serial.println("Forward"); + stepper.step(STEPS); + Serial.println("Backward"); + stepper.step(-STEPS); +} diff --git a/Adafruit_DRV8833/circuitpython/onoff/code.py b/Adafruit_DRV8833/circuitpython/onoff/code.py new file mode 100644 index 000000000..104405fde --- /dev/null +++ b/Adafruit_DRV8833/circuitpython/onoff/code.py @@ -0,0 +1,37 @@ +# SPDX-FileCopyrightText: 2025 Carter Nelson for Adafruit Industries +# +# SPDX-License-Identifier: MIT + +import time +import board +import digitalio + +# Configure pins +AIN1 = digitalio.DigitalInOut(board.D5) +AIN2 = digitalio.DigitalInOut(board.D6) +SLP = digitalio.DigitalInOut(board.D7) + +AIN1.switch_to_output() +AIN2.switch_to_output() +SLP.switch_to_output() + +# Enable DRV8833 +SLP.value = True + +# Loop forever +while True: + # + # FORWARD + # + print("Forward") + AIN1.value = True + AIN2.value = False + time.sleep(1) + + # + # REVERSE + # + print("Reverse") + AIN1.value = False + AIN2.value = True + time.sleep(1) diff --git a/Adafruit_DRV8833/circuitpython/pwm/code.py b/Adafruit_DRV8833/circuitpython/pwm/code.py new file mode 100644 index 000000000..d1f542eb4 --- /dev/null +++ b/Adafruit_DRV8833/circuitpython/pwm/code.py @@ -0,0 +1,48 @@ +# SPDX-FileCopyrightText: 2025 Carter Nelson for Adafruit Industries +# +# SPDX-License-Identifier: MIT + +import time +import board +import digitalio +import pwmio + +# Configure pins +AIN1 = pwmio.PWMOut(board.D5, frequency=2000) +AIN2 = pwmio.PWMOut(board.D6, frequency=2000) +SLP = digitalio.DigitalInOut(board.D7) + +SLP.switch_to_output() + +# Enable DRV8833 +SLP.value = True + +# Loop forever +while True: + # + # FORWARD + # + print("Forward") + AIN2.duty_cycle = 0 + print(" ramping up") + for duty_cycle in range(0, 65536, 100): + AIN1.duty_cycle = duty_cycle + time.sleep(0.01) + print(" ramping down") + for duty_cycle in range(65535, -1, -100): + AIN1.duty_cycle = duty_cycle + time.sleep(0.01) + + # + # REVERSE + # + print("Reverse") + AIN1.duty_cycle = 0 + print(" ramping up") + for duty_cycle in range(0, 65536, 100): + AIN2.duty_cycle = duty_cycle + time.sleep(0.01) + print(" ramping down") + for duty_cycle in range(65535, -1, -100): + AIN2.duty_cycle = duty_cycle + time.sleep(0.01) diff --git a/Factory_Tests/Feather_RP2040_Adalogger/Feather_RP2040_Adalogger.ino b/Factory_Tests/Feather_RP2040_Adalogger/Feather_RP2040_Adalogger.ino index ea74524b6..00d5482df 100644 --- a/Factory_Tests/Feather_RP2040_Adalogger/Feather_RP2040_Adalogger.ino +++ b/Factory_Tests/Feather_RP2040_Adalogger/Feather_RP2040_Adalogger.ino @@ -2,9 +2,8 @@ // // SPDX-License-Identifier: MIT -#include #include -#include "Adafruit_TestBed.h" +#include SdFat SD; SdFile file; diff --git a/library.deps b/library.deps index 6dba57652..29bda47a3 100644 --- a/library.deps +++ b/library.deps @@ -1 +1 @@ -depends=Adafruit ILI9341, Adafruit BusIO, SD, Adafruit NeoPixel, Adafruit VS1053 Library, Adafruit BluefruitLE nRF51, Adafruit seesaw Library, Ethernet, Adafruit IO Arduino, FastLED, Adafruit LiquidCrystal, Adafruit SoftServo, TinyWireM, Adafruit AM radio library, WaveHC, Adafruit LED Backpack Library, MAX31850 OneWire, Adafruit VC0706 Serial Camera Library, RTClib, Adafruit SleepyDog Library, Adafruit Thermal Printer Library, Adafruit Zero I2S Library, Adafruit EPD, Adafruit SSD1351 library, Adafruit FONA Library, Adafruit Motor Shield V2 Library, Adafruit NeoMatrix, Adafruit Soundboard library, Adafruit Circuit Playground, ArduinoJson, Adafruit TCS34725, Adafruit Pixie, Adafruit GPS Library, TinyGPS, WiFi101, Adafruit DotStar, Adafruit Si7021 Library, Adafruit WS2801 Library, Mouse, Keyboard, Time, IRremote, Adafruit LSM9DS0 Library, Adafruit Arcada Library, MIDIUSB, PubSubClient, Adafruit LIS2MDL, Adafruit NeoPXL8, Adafruit MCP23017 Arduino Library, Adafruit MLX90640, LiquidCrystal, Adafruit NeoTrellis M4 Library, RGB matrix Panel, Adafruit MLX90614 Library, Adafruit RGB LCD Shield Library, MAX6675 library, Adafruit MP3, Adafruit Keypad, Adafruit Arcada GifDecoder, Keypad, Neosegment, Encoder, Adafruit TiCoServo, Adafruit Trellis Library, FauxmoESP, Adafruit LSM303 Accel, Adafruit LSM303DLH Mag, Adafruit LSM303DLHC, CapacitiveSensor, Adafruit Zero PDM Library, Adafruit DMA neopixel library, elapsedMillis, DST RTC, Adafruit SHARP Memory Display, Adafruit SPIFlash, BSEC Software Library, WiiChuck, Adafruit DPS310, Adafruit AHTX0, RotaryEncoder, Adafruit MCP9808 Library, LSM303, Adafruit Protomatter, Adafruit IS31FL3741 Library, Sensirion I2C SCD4x, Adafruit TestBed, Bounce2, Adafruit AHRS, Adafruit DRV2605 Library, STM32duino VL53L4CD, PicoDVI - Adafruit Fork, Adafruit MMA8451 Library, Adafruit TSC2007, GFX Library for Arduino, Adafruit PyCamera Library, Adafruit ADG72x, Adafruit BNO055, Adafruit SHT4x Library, Adafruit VCNL4200 Library, Adafruit GC9A01A, Adafruit DVI HSTX +depends=Adafruit ILI9341, Adafruit BusIO, SD, Adafruit NeoPixel, Adafruit VS1053 Library, Adafruit BluefruitLE nRF51, Adafruit seesaw Library, Ethernet, Stepper, Adafruit IO Arduino, FastLED, Adafruit LiquidCrystal, Adafruit SoftServo, TinyWireM, Adafruit AM radio library, WaveHC, Adafruit LED Backpack Library, MAX31850 OneWire, Adafruit VC0706 Serial Camera Library, RTClib, Adafruit SleepyDog Library, Adafruit Thermal Printer Library, Adafruit Zero I2S Library, Adafruit EPD, Adafruit SSD1351 library, Adafruit FONA Library, Adafruit Motor Shield V2 Library, Adafruit NeoMatrix, Adafruit Soundboard library, Adafruit Circuit Playground, ArduinoJson, Adafruit TCS34725, Adafruit Pixie, Adafruit GPS Library, TinyGPS, WiFi101, Adafruit DotStar, Adafruit Si7021 Library, Adafruit WS2801 Library, Mouse, Keyboard, Time, IRremote, Adafruit LSM9DS0 Library, Adafruit Arcada Library, MIDIUSB, PubSubClient, Adafruit LIS2MDL, Adafruit NeoPXL8, Adafruit MCP23017 Arduino Library, Adafruit MLX90640, LiquidCrystal, Adafruit NeoTrellis M4 Library, RGB matrix Panel, Adafruit MLX90614 Library, Adafruit RGB LCD Shield Library, MAX6675 library, Adafruit MP3, Adafruit Keypad, Adafruit Arcada GifDecoder, Keypad, Neosegment, Encoder, Adafruit TiCoServo, Adafruit Trellis Library, FauxmoESP, Adafruit LSM303 Accel, Adafruit LSM303DLH Mag, Adafruit LSM303DLHC, CapacitiveSensor, Adafruit Zero PDM Library, Adafruit DMA neopixel library, elapsedMillis, DST RTC, Adafruit SHARP Memory Display, Adafruit SPIFlash, BSEC Software Library, WiiChuck, Adafruit DPS310, Adafruit AHTX0, RotaryEncoder, Adafruit MCP9808 Library, LSM303, Adafruit Protomatter, Adafruit IS31FL3741 Library, Sensirion I2C SCD4x, Adafruit TestBed, Bounce2, Adafruit AHRS, Adafruit DRV2605 Library, STM32duino VL53L4CD, PicoDVI - Adafruit Fork, Adafruit MMA8451 Library, Adafruit TSC2007, GFX Library for Arduino, Adafruit PyCamera Library, Adafruit ADG72x, Adafruit BNO055, Adafruit SHT4x Library, Adafruit VCNL4200 Library, Adafruit GC9A01A, Adafruit DVI HSTX