I have figured out why my code stopped working, and tried my theory on an off-the-shelf program example. It also stopped working.
Here's the code that works only if you "un-comment out" line 18, the line with "//CircuitPlayground.begin();"
Below is a copy of the Adafruit_seesaw_Library/Examples/Crickit/motor/dual_motor.ino that has two extra lines:
#include <Adafruit_CircuitPlayground.h>
CircuitPlayground.begin(); //in void setup()
Code: Select all
#include "Adafruit_Crickit.h"
#include "seesaw_motor.h"
#include <Adafruit_CircuitPlayground.h>
Adafruit_Crickit crickit;
seesaw_Motor motor_a(&crickit);
seesaw_Motor motor_b(&crickit);
void setup() {
Serial.begin(115200);
Serial.println("Dual motor demo!");
if(!crickit.begin()){
Serial.println("ERROR!");
while(1) delay(1);
}
else Serial.println("Crickit started");
//CircuitPlayground.begin();
//attach motor a
motor_a.attach(CRICKIT_MOTOR_A1, CRICKIT_MOTOR_A2);
//attach motor b
motor_b.attach(CRICKIT_MOTOR_B1, CRICKIT_MOTOR_B2);
}
void loop() {
motor_a.throttle(1);
motor_b.throttle(-1);
delay(1000);
motor_a.throttle(.5);
motor_b.throttle(-.5);
delay(1000);
motor_a.throttle(0);
motor_b.throttle(0);
delay(1000);
motor_a.throttle(-.5);
motor_b.throttle(.5);
delay(1000);
motor_a.throttle(-1);
motor_b.throttle(1);
delay(1000);
motor_a.throttle(0);
motor_b.throttle(0);
delay(500);
}
What should I do to make this work? I can include my code, but this code displayed here clarifies that it's not my code that is the problem, it's the incompatible libraries, Crickit and Playground, which is hard to believe - given that Crickit is meant to work with Playground.
Thanks for your help!