forked from NattyBumppo/Simon-Clone-for-Arduino
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Output.h
42 lines (31 loc) · 876 Bytes
/
Output.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
34
35
36
37
38
39
40
41
/*
Functions to manipulate lights on the Arduino. Some sound-related code is also included.
*/
#ifndef LIGHTS_H
#define LIGHTS_H
#include "gameplay.h"
class Output
{
public:
static Output& Get();
void Update(int dT);
// Turns a color on, with unlimited duration.
void LightOn(Color color);
// Turns a color on, and sets the duration for it to turn off.
void LightOn(Color color, int duration);
void LightOff(Color color);
// Turns a tone on, and sets the duration for it to turn off.
void SetTone(Color color, int duraction);
void SetTone(int freq, int duraction);
// Turn off all LEDs
void ClearLights();
private:
Output();
Output(const Output& rhs);
Output& operator=(const Output& rhs);
static Output* spInstance;
void SetLight(int color, int duration, int state);
int lightOffTime[4];
int soundOffTime;
};
#endif