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

Slow down of loop when servo used #34

Open
pelikhan opened this issue Dec 16, 2017 · 2 comments
Open

Slow down of loop when servo used #34

pelikhan opened this issue Dec 16, 2017 · 2 comments
Assignees
Labels

Comments

@pelikhan
Copy link
Contributor

pelikhan commented Dec 16, 2017

Running this program on CPX + SG92R on pin A1,

  • on battery, it grinds to a locks within seconds.
  • on USB, it slows down to a grind after a minute
#include "CircuitPlayground.h"

CircuitPlayground cplay;

int main()
{
    int status = 0;
    while(1)
    {
        cplay.io.led.setDigitalValue(status);
        cplay.io.a1.setServoValue(30 + rand() % 15);
        cplay.sleep(20);
        status = !status;
    }
}
@mmoskal
Copy link
Contributor

mmoskal commented Dec 17, 2017

I don't see it. Do you actually need to have the servo connected?

@pelikhan
Copy link
Contributor Author

pelikhan commented Dec 17, 2017 via email

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

No branches or pull requests

3 participants