kdomen/fishDispenser — pull request #7 by ryanmjacobs (2014-10-17 04:28:03+00:00)
Title: Big change, but more logical.

I know it's a big change and all, but really this is a change for the better.

First of all, I moved all of the inline code from the main loop into separate functions. This is an easier way to maintain the logic's visibility.
Now the main loop is a simple as 3 steps:
```
void loop() {
delay(1000);

/* Decrement 1 second from next feeding */
bool feedFishNow = adjustTime(&next, -1);

/* Update the LCD */
updateLCD();

/* Feed fish if timer hits zero */
if (feedFishNow) feedFish();
}
```

And secondly, I have changed the way we represent time. Now it is represented as an object, (we call this a `struct` in C, for data structure).
It is a lot easier to work with because now we can reference them like:
```
if (nextTime.seconds == 14)
nextTime.minutes = 123;
```
And set all three values like:
```
// set seconds=1, minutes=2, hours=3
struct Time nextTime = { 1, 2, 3 };
```