Skip to content
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

stop loop to overwrite #21

Open
truesamurai opened this issue Jan 1, 2020 · 2 comments
Open

stop loop to overwrite #21

truesamurai opened this issue Jan 1, 2020 · 2 comments

Comments

@truesamurai
Copy link

I tried digisparkkeyboard and it works fine. Now I want to ovewrite with another payload. But everytime I plug in the Digispark it starts to type text automatically, so I can not upload another payload to the Digispark anymore. How can I proceed?

@Bluebie
Copy link
Contributor

Bluebie commented Jan 2, 2020

Make sure you press Upload in Arduino before you plug the digispark in. The upload program should wait for it, and catch the bootloader before it runs the keyboard program, and upload the new sketch. If that doesn’t work, try a different usb port, or try doing it through a usb hub. some newer USB 3 ports have been known to struggle with digispark.

@ghost
Copy link

ghost commented Aug 29, 2022

There are two ways to stop loop ovewrite -

  1. If you want to run your payload once, then write it into the setup function of Arduino ide because when the board gets powered from USB then firstly the bootloader run, then it jumps to the main file where it runs the setup function because it runs only one time then the loop function because it runs continuously until the board is removed from the system.

  2. If you want to put your code in a loop function, then add a loop after your instructions because it follows a linear way of execution.
    The loop is

for ( ; ; )
{
}

Thank You

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants