WEMOS_Motor_Shield_Arduino_Library icon indicating copy to clipboard operation
WEMOS_Motor_Shield_Arduino_Library copied to clipboard

Code restarting

Open gnidlih opened this issue 9 years ago • 2 comments

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.

gnidlih avatar Sep 22 '16 09:09 gnidlih

Thanks! That was indeed very helpfull.

BenoitWickramarachi avatar Jun 04 '17 00:06 BenoitWickramarachi

It works with AVR controllers!

oleglyan avatar Dec 27 '19 11:12 oleglyan