initial commit

This commit is contained in:
dan
2021-12-23 14:44:12 -05:00
commit 778bd82954
12 changed files with 254 additions and 0 deletions

69
ship.ino Normal file
View File

@@ -0,0 +1,69 @@
void ship(int hours, int minutes)
{
if (minutes == 00 && chimed == 0)
{
Serial.println("Top of hour");
if ( hours == 12 || hours == 4 || hours == 8 || hours == 0 || hours == 16 || hours == 20 )
{
doubleChime();
doubleChime();
doubleChime();
doubleChime();
chimed = 1;
}
else if ( hours == 1 || hours == 5 || hours == 9 || hours == 13 || hours == 17 || hours == 21 )
{
doubleChime();
chimed = 1;
}
else if ( hours == 2 || hours == 6 || hours == 10 || hours == 14 || hours == 18 || hours == 22 )
{
doubleChime();
doubleChime();
chimed = 1;
}
else if ( hours == 3 || hours == 7 || hours == 11 || hours == 15 || hours == 19 || hours == 23 )
{
doubleChime();
doubleChime();
doubleChime();
chimed = 1;
}
}
else if (minutes == 30 && chimed == 0)
{
Serial.println("bottom of hour");
if ( hours == 12 || hours == 4 || hours == 8 || hours == 0 || hours == 16 || hours == 20 )
{
singleChime();
chimed = 1;
}
else if ( hours == 1 || hours == 5 || hours == 9 || hours == 13 || hours == 17 || hours == 21 )
{
doubleChime();
singleChime();
chimed = 1;
}
else if ( hours == 2 || hours == 6 || hours == 10 || hours == 14 || hours == 18 || hours == 22 )
{
doubleChime();
doubleChime();
singleChime();
chimed = 1;
}
else if ( hours == 3 || hours == 7 || hours == 11 || hours == 15 || hours == 19 || hours == 23 )
{
doubleChime();
doubleChime();
doubleChime();
singleChime();
chimed = 1;
}
}
else if (chimed == 1 && minutes == 01 || chimed == 1 && minutes == 31 )
{
Serial.println("Reset chime");
chimed = 0;
}
}