Skip to content

Code restarting #2

@gnidlih

Description

@gnidlih

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions