Each of the FlexAR coil is switched on/off using a generic NPN PN2222A transistor (with 1K resistor on the base). This is the latest code I used to drive it. Very touchy, you may or may not be able to replicate my result
const byte magnetPins[] = {2, 3, 4};
int delayBetweenMagnets = 20; // ms
int magnetOnTime = 40; // ms
const byte OFF = LOW;
const byte ON = HIGH;
void setup() {
for (byte i = 0; i < 3; i++) {
pinMode(magnetPins[i], OUTPUT);
digitalWrite(magnetPins[i], OFF);
}
}
void SetMagnets(byte a, byte b, byte c)
{
digitalWrite(magnetPins[0], a);
digitalWrite(magnetPins[1], b);
digitalWrite(magnetPins[2], c);
delay(magnetOnTime);
}
// 0-, 01, 12, 2-,
void loop() {
SetMagnets(ON, OFF, OFF); // *--
SetMagnets(ON, ON, OFF); // **-
SetMagnets(OFF, ON, OFF); // -*-
SetMagnets(OFF, ON, ON); // -**
SetMagnets(OFF, OFF, ON); // --*
SetMagnets(ON, OFF, ON); // *-*
}