#include <CodeCell.h>
#include <CoilCell.h>
// Pick the two CodeCell GPIO pins wired to CoilCell IN1 and IN2.
// Replace these with the actual pins you are using.
#define COIL_IN1 8
#define COIL_IN2 9
CodeCell myCodeCell;
CoilCell myCoilCell(COIL_IN1, COIL_IN2);
void setup() {
Serial.begin(115200);
// Initialize CodeCell.
// Use LIGHT only if you need light/proximity sensor functions.
// Use 0 if you only want GPIO/power handling.
myCodeCell.Init(0);
// Initialize CoilCell GPIO/PWM driver.
myCoilCell.Init();
Serial.println("CodeCell + CoilCell ready");
}
void loop() {
// Drive one polarity at 75% power
myCoilCell.Drive(true, 75);
delay(500);
// Drive opposite polarity at 75% power
myCoilCell.Drive(false, 75);
delay(500);
// Stop / low power
myCoilCell.Drive(true, 0);
delay(1000);
}
Conflicts in the 2 libraries prevents this code from compiling:
I only wanted to control a CoilCell from a CodeCell.