#include <Arduino.h>
// D5 now switches a PN2222 low-side coil driver. The manual's L293D coil bridge is replaced.
const uint8_t RELAY_PIN = 5;
void setup() {
  digitalWrite(RELAY_PIN, LOW);  // Keep the coil off when making the pin an output.
  pinMode(RELAY_PIN, OUTPUT);
  Serial.begin(9600);
}
void loop() {
  for (uint8_t i = 0; i < 5; ++i) {
    Serial.println("spin");
    digitalWrite(RELAY_PIN, HIGH);  // Energize the coil: COM joins NO, powering the DC motor.
    delay(2000);
    Serial.println("stop");
    digitalWrite(RELAY_PIN, LOW);   // Release the coil: the normally-open contact opens.
    delay(2000);
  }
  // The outer loop starts another five-cycle group, just like the manufacturer's example.
}
