-
Notifications
You must be signed in to change notification settings - Fork 36
Object instantiation causes a reset #79
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
Comments
Drivers should reset the peripheral to ensure the script runs the same each time. Leaving previous state can cause the script to change behavior without it being obvious why. Why do you need to share state across scripts? A plugin system could achieve similar flexibility without restarting everything. I agree though that there should be an option to turn off the reset. Perhaps a |
Thanks for the response. The drivers for many of the breakouts offered by Adafruit do not reset the device upon instantiation. In my case, I was attempting to run small scripts in response to sensor input. This is part of an an application developed by someone else that polls using input modules and responds using output modules. There's no option to retain objects between polling and output cycles. |
I think this was fixed by the linked commit above. Is that correct, @ladyada? |
yep! |
Having a reset on the board when you create an instance of the Seesaw object limits a lot of applications of the device. The libraries for other breakouts don't do this. Most assume the current state persists unless you power off or reset.
Having the option to not reset would be beneficial.
In my example, I have separate scripts that are called by a master program. In the case, I trigger a PWM signal on one pin. Calling another script that reads the ADC on another pin resets the PWM signal.
The text was updated successfully, but these errors were encountered: