forked from robogalsbrisbane/RGBris-Arduino
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRGBris-Arduino-master.ino
More file actions
55 lines (44 loc) · 1.03 KB
/
RGBris-Arduino-master.ino
File metadata and controls
55 lines (44 loc) · 1.03 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
#include "RGBris_Arduino_Lib.h"
/**
* Define the modules here, specify the pins
*/
// Connect a button on pin 7
Button button(7);
// Connect a led on pin 13
LED whitLED(13);
LED bluLED(12);
// Connect the piezo on pin 6
Buzzer buzzer(6);
// Connect the seg display on pins 11, 12, 8
SegDisplay segDisplay(11, 12, 8);
void setup() {
// Setup the modules
whiteLED.setup();
blueLED.setup();
button.setup();
buzzer.setup();
segDisplay.setup();
buzzer.playPiratesOfTheCarribean();
}
void loop() {
// put your main code here, to run repeatedly
// Check if the button is pressed
whiteLED.turnOn();
blueLED.turnOff();
delay(1000);
whiteLED.turnOff();
blueLED.turnOn();
delay(1000);
/**if (button.isPressed()) {
led.turnOn();
piezo.play(NOTE_C8, 500);
for(int i = 0; i < 10; i++) {
segDisplay.writeNumber(i);
delay(100);
}
segDisplay.turnOff();
led.turnOff();
} else {
led.turnOff();
} **/
}