You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
}
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.
The text was updated successfully, but these errors were encountered: