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
importboardimporttimeimportarrayimportpulseiof=open("/codes.txt", "r") # https://github.com/mario872/Sonic-Screwdriver/blob/main/Software/src/codes.txt# Just moved some lines around from https://raw.githubusercontent.com/adafruit/Adafruit_Learning_System_Guides/master/CircuitPython_TVBGone/codes.txtinput() # To make sure I can tell it when to startcount=0forlineinf:
code=eval(line)
print(code)
# If this is a repeating code, extract detailstry:
repeat=code["repeat"]
delay=code["repeat_delay"]
exceptKeyError: # by default, repeat once only!repeat=1delay=0# The table holds the on/off pairstable=code["table"]
pulses= [] # store the pulses here# Read through each indexed elementforiincode["index"]:
pulses+=table[i] # and add to the list of pulsespulses.pop() # remove one final 'low' pulsewithpulseio.PulseOut(
board.D13, frequency=code["freq"], duty_cycle=2**15
) aspulse:
foriinrange(repeat):
pulse.send(array.array("H", pulses))
time.sleep(delay)
time.sleep(code["delay"])
count+=1
Behavior
When running the above code it gets around 3-6 repeats in then I get:
Auto-reload is off.
Running in safe mode! Not running saved code.
You are in safe mode because:
CircuitPython core code crashed hard. Whoops!
Hard fault: memory access or instruction error.
Please file an issue with your program at github.com/adafruit/circuitpython/issues.
Press reset to exit safe mode.
Interestingly, when I run a more complicated program, with this script basically as a function instead, I get:
Auto-reload is off.
Running in safe mode! Not running saved code.
You are in safe mode because:
Internal watchdog timer expired.
Press reset to exit safe mode.
Description
N/A
Additional information
Running a very similar script on the RPi Pico 2 W didn't produce any error less than two weeks ago (with that build of CP from two weeks ago
Then is goes into safe mode. Edit 4: (Hard Fault: memory access or instruction error)
Edit 3: It appears that then removing any line with an index of [0] fixes that issue, then changing the time.sleep(0.01) to time.sleep(1) stops CP from crashing at all.
Edit 5: There are no lines with and index of [0] until line 128, and with no delay it fails way before then.
The text was updated successfully, but these errors were encountered:
CircuitPython version
Code/REPL
Behavior
When running the above code it gets around 3-6 repeats in then I get:
Interestingly, when I run a more complicated program, with this script basically as a function instead, I get:
Description
N/A
Additional information
Running a very similar script on the RPi Pico 2 W didn't produce any error less than two weeks ago (with that build of CP from two weeks ago
Edit: Here's the longer program code: https://github.com/mario872/Sonic-Screwdriver/tree/main/Software/src/v5.3
Edit 2: Changing the pulseio.PulseOut line to:
Makes it work until line 128 of codes.txt, until it gives this error:
Then is goes into safe mode. Edit 4: (Hard Fault: memory access or instruction error)
Edit 3: It appears that then removing any line with an index of
[0]
fixes that issue, then changing thetime.sleep(0.01)
totime.sleep(1)
stops CP from crashing at all.Edit 5: There are no lines with and index of
[0]
until line 128, and with no delay it fails way before then.The text was updated successfully, but these errors were encountered: