Arduino, H Bridge, electromagnetic actuator
int pin1 = 6;
int pin2 = 9;
int d = 500;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(pin1, OUTPUT);
pinMode(pin2, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(pin1, HIGH);
digitalWrite(pin2, LOW);
delay(d);
digitalWrite(pin1, LOW);
digitalWrite(pin2, HIGH);
delay(d);
}