WPIRoboticsEngineering / RBE1001Lib

A library to support introduction to robotics engineering.
MIT License
4 stars 4 forks source link

Jumping when uploading #27

Closed gcl8a closed 4 years ago

gcl8a commented 4 years ago

When uploading to the ESP32, the motors will spin momentarily, as if it is running the last program for a short period of time.

madhephaestus commented 4 years ago

is this while the upload is writing, or before that?

Generally its a good practice to always set the motors to disabled while programming.

gcl8a commented 4 years ago

Right around when it starts to upload. It’s not realistic to have them plug the wire in everytime (and not possible with the shim board). We need a failsafe.

On Aug 7, 2020, at 3:36 PM, Kevin Harrington notifications@github.com wrote:

is this while the upload is writing, or before that?

Generally its a good practice to always set the motors to disabled while programming.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/WPIRoboticsEngineering/RBE1001Lib/issues/27#issuecomment-670679974, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF5JK5EU5UN3Z7IT3WUSCWLR7RJVNANCNFSM4PX5WUAQ.

madhephaestus commented 4 years ago

We should go over your wiring, i can not reproduce the problem on my hardware. Is it that your program has it run right off the boot? What INO is causing this behavior?

FYI: the shim has a jumper for motor disable right near the user sensor headers and it it easy to get to.

gcl8a commented 4 years ago

I think I discovered what the issue is: when it first starts to upload, it does something to the BOOT pin. But I use the BOOT button for gatekeeping:

while(!digitialRead(0)) {}

So when it gets ready to upload, a button signal will get sent, the code will run for, say, half a second, then the upload will start.

On Aug 17, 2020, at 3:45 PM, Kevin Harrington notifications@github.com wrote:

Closed #27 https://github.com/WPIRoboticsEngineering/RBE1001Lib/issues/27.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/WPIRoboticsEngineering/RBE1001Lib/issues/27#event-3663355154, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF5JK5HOCLHYX3TQOVVHRWDSBGCFVANCNFSM4PX5WUAQ.

madhephaestus commented 4 years ago

AH, are you explicitly setting the button to INPUT_PULLUP? There is no external pull up on that pin, so it may be that the reset on program clears the Pullup from the internal bootloader use of the pin, causing it to move.