You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
===========================================================================# SPDX-FileCopyrightText: 2022 John Park and Tod Kurt for Adafruit Industries# SPDX-License-Identifier: MIT
'''Walkmp3rsondigitalcassettetapeplayer (okfineit's just SD cards)'''importtimeimportosimportboardimportbusioimportsdcardioimportstorageimportaudiomixerimportaudiobusioimportaudiomp3fromadafruit_neokey.neokey1x4importNeoKey1x4fromadafruit_seesawimportseesaw, rotaryioimportdisplayioimportterminaliofromadafruit_display_textimportlabelfromadafruit_st7789importST7789fromadafruit_progressbar.progressbarimportHorizontalProgressBarfromadafruit_progressbar.verticalprogressbarimportVerticalProgressBardisplayio.release_displays()
# SPI for TFT display, and SD Card reader on TFT displayspi=board.SPI()
# display setuptft_cs=board.D6tft_dc=board.D9tft_reset=board.D12display_bus=displayio.FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=tft_reset)
display=ST7789(display_bus, width=320, height=240, rotation=90)
# SD Card setupsd_cs=board.D13sdcard=sdcardio.SDCard(spi, sd_cs)
vfs=storage.VfsFat(sdcard)
storage.mount(vfs, "/sd")
# I2C NeoKey setupi2c=busio.I2C(board.SCL, board.SDA)
neokey=NeoKey1x4(i2c, addr=0x30)
amber=0x300800red=0x900000green=0x009000neokey.pixels.fill(amber)
keys= [
(neokey, 0, green),
(neokey, 1, red),
(neokey, 2, green),
(neokey, 3, green),
]
# states for key presseskey_states= [False, False, False, False]
# STEMMA QT Rotary encoder setuprotary_seesaw=seesaw.Seesaw(i2c, addr=0x36) # default address is 0x36encoder=rotaryio.IncrementalEncoder(rotary_seesaw)
last_encoder_pos=0# file system setupmp3s= []
forfilenameinos.listdir('/sd'):
iffilename.lower().endswith('.mp3') andnotfilename.startswith('.'):
mp3s.append("/sd/"+filename)
mp3s.sort() # sort alphanumerically for mixtape order, e.g., "1_King_of_Rock.mp3"formp3inmp3s:
print(mp3)
track_number=0mp3_filename=mp3s[track_number]
mp3_bytes=os.stat(mp3_filename)[6] # size in bytes is position 6mp3_file=open(mp3_filename, "rb")
mp3stream=audiomp3.MP3Decoder(mp3_file)
Behavior
Walkmp3rson program crashes. Does not display anything on TFT display. If connected to Windows PC, I get a Windows error message stating the USB drive is not recognizable and disconnect the CIRCUITPY drive from my PC. If I comment the line >>> mp3stream = audiomp3.MP3Decoder(mp3_file) <<< then the program continue for until the next error which is mp3stream not defined, naturally.
Thank you for all your help and understanding. ThinMan
Description
on a RP2040 Feather used in JP Learn guide Walkmp3rson. Used all parts described in guide. Works fine using CP version 8.12. Found issue with module audiomp3 in CP 9.x. Here below is the example I used to cause the crash. If I comment out the last line the program continues on. The code is the same as JP guide.
Additional information
When this line is commented out the program continues
mp3stream = audiomp3.MP3Decoder(mp3_file)
The text was updated successfully, but these errors were encountered:
CircuitPython version
Code/REPL
Behavior
Walkmp3rson program crashes. Does not display anything on TFT display. If connected to Windows PC, I get a Windows error message stating the USB drive is not recognizable and disconnect the CIRCUITPY drive from my PC. If I comment the line >>> mp3stream = audiomp3.MP3Decoder(mp3_file) <<< then the program continue for until the next error which is mp3stream not defined, naturally.
Thank you for all your help and understanding. ThinMan
Description
on a RP2040 Feather used in JP Learn guide Walkmp3rson. Used all parts described in guide. Works fine using CP version 8.12. Found issue with module audiomp3 in CP 9.x. Here below is the example I used to cause the crash. If I comment out the last line the program continues on. The code is the same as JP guide.
Additional information
When this line is commented out the program continues
mp3stream = audiomp3.MP3Decoder(mp3_file)
The text was updated successfully, but these errors were encountered: