Skip to content
Discussion options

You must be logged in to vote

I took a quick look at the datasheet and it seems like this device should work with the machine.I2S class.

  1. The ADC device should be configured in slave mode.
  2. Yes. Use machine.PWM to create a 256*fs clock.

To extract 32-bit samples for L/R you'll need to iterate over the data that is read into the bytearray. Here is some untested code that might help. You'll need to add some additional code to test a condition to exit the while loop. The real micropython experts will likely have a better way to do this, but this is a start.

left_samples = []
right_samples = []
while True:
    num_bytes_read = i2s.readinto(samples) # read samples from the I2S peripheral
    for i in range(0, len(samples )…

Replies: 6 comments 18 replies

Comment options

You must be logged in to vote
1 reply
@saraverbeecke
Comment options

Answer selected by saraverbeecke
Comment options

You must be logged in to vote
11 replies
@frohro
Comment options

@miketeachman
Comment options

@frohro
Comment options

@robert-hh
Comment options

@frohro
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@frohro
Comment options

@robert-hh
Comment options

@robert-hh
Comment options

@frohro
Comment options

@frohro
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
ESP32
Labels
None yet
4 participants