-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFunctions.cpp
More file actions
56 lines (51 loc) · 1.17 KB
/
Functions.cpp
File metadata and controls
56 lines (51 loc) · 1.17 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include "Functions.h"
#include <Arduino.h>
#include "Switchable.h"
#include "Colours.h"
Switchable red_led(LED_RED);
Switchable blue_led(LED_BLUE);
Switchable orange_led(LED_ORANGE);
Colours colours;
Functions::Functions(){
}
//turn on:
void Functions::turnOn(int colour)
{
switch (colour)
{
case COLOR_RED:
if(!red_led.getState()){
red_led.on();
blue_led.off();
orange_led.off();
}
break;
case COLOR_ORANGE:
if(!orange_led.getState()){
orange_led.on();
blue_led.off();
red_led.off();
}
break;
case COLOR_BLUE:
if(!blue_led.getState()){
blue_led.on();
red_led.off();
orange_led.off();
}
break;
default:
break;
}
}
void Functions::turnOffAll(){
if(red_led.getState()){
red_led.off();
}
if(orange_led.getState()){
orange_led.off();
}
if(blue_led.getState()){
blue_led.off();
}
}