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

Code restarting #2

Open
gnidlih opened this issue Sep 22, 2016 · 2 comments
Open

Code restarting #2

gnidlih opened this issue Sep 22, 2016 · 2 comments

Comments

@gnidlih
Copy link

gnidlih commented Sep 22, 2016

First the code didn't build until I included Wire.h then I couldn't get the code to run on my wemos d1, It simply restarted again and again showing rst cause:2, boot mode:(3,7)

First after I added wire.h and changed the code to use pointers and called the Motor constructor from setup(), it worked.

include <Wire.h>

...

Motor *M1 = NULL;
Motor *M2 = NULL;

void setup() {
delay(1000);
Serial.begin(115200);
M1 = new Motor(0x30,_MOTOR_A, 1000);//Motor A
M2 = new Motor(0x30,_MOTOR_B, 1000);//Motor B
}

void loop() {

for (pwm = 0; pwm <= 100; pwm++)
{
M1->setmotor( _CW, pwm);

...etc..

Hopefully it helps someone.

@BenoitWickramarachi
Copy link

Thanks! That was indeed very helpfull.

@oleglyan
Copy link

oleglyan commented Dec 27, 2019

It works with AVR controllers!

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

3 participants