Skip to content

add hardware reset to examples #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,17 @@ Usage Example
import audiobusio
import audiocore
import board
import digitalio

import adafruit_tlv320

# Reset the DAC before use
reset_pin = digitalio.DigitalInOut(board.D12)
reset_pin.direction = digitalio.Direction.OUTPUT
reset_pin.value = False # Set low to reset
time.sleep(0.1) # Pause 100ms
reset_pin.value = True # Set high to release from reset

i2c = board.I2C()
dac = adafruit_tlv320.TLV320DAC3100(i2c)

Expand Down
8 changes: 8 additions & 0 deletions examples/tlv320_fulltest.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import time

import board
import digitalio

from adafruit_tlv320 import (
DAC_PATH_MIXED,
Expand Down Expand Up @@ -41,6 +42,13 @@
VOL_RIGHT_TO_LEFT,
)

# Reset the DAC before use
reset_pin = digitalio.DigitalInOut(board.D12)
reset_pin.direction = digitalio.Direction.OUTPUT
reset_pin.value = False # Set low to reset
time.sleep(0.1) # Pause 100ms
reset_pin.value = True # Set high to release from reset

print("Initializing I2C and TLV320DAC3100...")
i2c = board.I2C()
dac = TLV320DAC3100(i2c)
Expand Down
8 changes: 8 additions & 0 deletions examples/tlv320_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,17 @@
import audiobusio
import audiocore
import board
import digitalio

import adafruit_tlv320

# Reset the DAC before use
reset_pin = digitalio.DigitalInOut(board.D12)
reset_pin.direction = digitalio.Direction.OUTPUT
reset_pin.value = False # Set low to reset
time.sleep(0.1) # Pause 100ms
reset_pin.value = True # Set high to release from reset

i2c = board.I2C()
dac = adafruit_tlv320.TLV320DAC3100(i2c)

Expand Down