forked from dstone/LCDUI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Controls.h
33 lines (28 loc) · 795 Bytes
/
Controls.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef Controls_h
#define Controls_h
#include "WProgram.h"
#include "InputDevices.h"
#include <LiquidCrystal.h>
class TimeChooser {
public:
TimeChooser( LiquidCrystal *lcd, RotaryEncoder *encoder );
int getTime();
private:
LiquidCrystal *_lcd;
RotaryEncoder *_encoder;
int8_t cursorSelect( int8_t locs[][2], int8_t count, int8_t pos=0 );
int getInt( char* pattern, int maxCal, int col, int row );
};
class CountdownTimer {
public:
CountdownTimer( LiquidCrystal *lcd, RotaryEncoder *encoder );
void start( int durationInSeconds );
private:
RotaryEncoder *_encoder;
LiquidCrystal *_lcd;
long startTime;
long duration;
long timeLeft();
void printTime();
};
#endif