Replies: 3 comments 3 replies
-
Before the |
Beta Was this translation helpful? Give feedback.
3 replies
-
An option might be to call |
Beta Was this translation helpful? Give feedback.
0 replies
-
The esp errors were:
You must perform a hard reset after a DAC is registered. A soft reset is not enough. Try the following: from machine import Pin, ADC, DAC, reset
try:
dac = DAC(Pin(25))
except OSError:
print("Unable to register DAC - need hard reset")
reset()
print(dac) There is a way to delete the channel in esp, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am using a ESP-WROOM-32 module. I erased the firmware, flashed it with ESP32_GENERIC-SPIRAM-20230426-v1.20.0.bin, and it works, sort of. I can access the ESP32 over /dev/ttyUSB0, load a micropython program, and run it. But only once. If I try to run it again, I get an error:
I have to remove power from the board in order to run the same code again.
This is my code - I am cycling through the DAC values and reading them with the ADC:
The output is:
If I try to run the program again, I get the error listed above. I believe the error comes from trying to allocate pin 25 again to the DAC. If I edit the program and try to run it again, I get the same error. I have spoken to other developers, and no one seems to be pulling the power on their ESP32 to re-run a program. I tried flashing an older micropython, and that did not work. I had planned to put the DAC specific code for my project in a class, and then call the class as needed. But the program fails because of the allocation of pin 25 to the DAC object. I have tried using the Arduino micropython IDE and Thonny IDE, and no combination of reset commands solves the problem.
I hope someone has a suggestion on how to fix this issue.
Beta Was this translation helpful? Give feedback.
All reactions