#include "ClockHand.h"
#include "ClockFace.h"

//ClockFace face = ClockFace({"one","two","three"});
ClockFace face2 = ClockFace({{"one", 90}, {"two", 180}, {"three", 270}});

void setup() {
  Serial.begin(9600);
  Serial.println("Starting...");
  Serial.println("got here");
  face2.print_zones();
  Serial.println();
  Serial.println(face2.zoneDegree("zero"));
}

void loop() {
  //Serial.println("got here");
}


#ifdef INCLUDE_THIS

const int stepsPerRevolution = 2048;  // change this to fit the number of steps per revolution
const int RevolutionsPerMinute = 17;         // Adjustable range of 28BYJ-48 stepper is 0~17 rpm

// initialize the stepper library on pins 8 through 11:
//ClockHand hand1(stepsPerRevolution, 8, 10, 9, 11);
ClockHand hand1(stepsPerRevolution, 2, 4, 3, 5);
ClockHand hand2(stepsPerRevolution, 6, 8, 7, 9);
ClockHand hand3(stepsPerRevolution, 10, 12, 11, 13);
ClockHand hand4(stepsPerRevolution, A0, A2, A1, A3);


void setup() {
  hand1.setSpeed(5);
  hand2.setSpeed(5);
  hand3.setSpeed(5);
  hand4.setSpeed(5);

  // initialize the serial port:
  Serial.begin(9600);
  
  while (Serial.available() <= 0)
  {
    hand1.step(1);
  }
  Serial.print("Input was: ");
  Serial.println(Serial.read());
  delay(50);
  while (Serial.available() <= 0)
  {
    hand2.step(1);
  }
  Serial.print("Input was: ");
  Serial.println(Serial.read());
  delay(50);
  while (Serial.available() <= 0)
  {
    hand3.step(1);
  }
  Serial.print("Input was: ");
  Serial.println(Serial.read());
  delay(50);
  while (Serial.available() <= 0)
  {
    hand4.step(1);
  }
  Serial.print("Input was: ");
  Serial.println(Serial.read());
  delay(2000);

  hand1.setSpeed(RevolutionsPerMinute);
  hand2.setSpeed(RevolutionsPerMinute);
  hand3.setSpeed(RevolutionsPerMinute);
  hand4.setSpeed(RevolutionsPerMinute);
}

void loop() {  
  // step one revolution  in one direction:
  Serial.println("clockwise");
  hand1.step(stepsPerRevolution);
  hand2.step(stepsPerRevolution);
  hand3.step(stepsPerRevolution);
  hand4.step(stepsPerRevolution);

  delay(500);

  // step one revolution in the other direction:
  Serial.println("counterclockwise");
  hand1.step(-stepsPerRevolution);
  hand2.step(-stepsPerRevolution);
  hand3.step(-stepsPerRevolution);
  hand4.step(-stepsPerRevolution);
}

#endif
