Hallo
I have Question about the Time Alarm Librarie.
The Question:
How i can change Alarm.timerRepeat look like my code below:
#include <Time.h>
#include <TimeAlarms.h>
void setup()
{
Serial.begin(9600);
}
void loop(){
char comRead = Serial.read();
if (comRead == 65) {
int pcHour = Serial.parseInt();
int pcMins = Serial.parseInt();
int pcSeconds = Serial.parseInt();
int StartHour = Serial.parseInt();
int StartMins = Serial.parseInt();
setTime(pcHour,pcMins,pcSeconds,2,3,15);
Alarm.timerRepeat(StartHour,StartMins,0, TestOne);
}
if (comRead == 66) {
int pcHour = Serial.parseInt();
int pcMins = Serial.parseInt();
int pcSeconds = Serial.parseInt();
int StopHour = Serial.parseInt();
int StopMins = Serial.parseInt();
setTime(pcHour,pcMins,pcSeconds,2,3,15);
Alarm.timerRepeat(StopHour,StopMins,0, TestTwo);
}
digitalClockDisplay();
Alarm.delay(1000); // wait one second between clock display
}
void TestOne() {
Serial.println("TESTONE");
}
void TestTwo() {
Serial.println("TESTTWO");
}
void digitalClockDisplay()
{
// digital clock display of the time
Serial.print(hour());
printDigits(minute());
printDigits(second());
Serial.println();
}
void printDigits(int digits)
{
Serial.print(":");
if(digits < 10)
Serial.print('0');
Serial.print(digits);
}
The problem is when i send the Stop Time the timer not working... It is posible to make that ? The idea is to make easily change the Alarm's