-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path3pinmed.ino
61 lines (52 loc) · 1.23 KB
/
3pinmed.ino
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
57
58
59
60
61
#include <time.h>
#include <TimeLib.h>
int ledPin1 = 12;
int ledPin2 = 10;
int ledPin3 = 8;
int blinkTime = 500;
int input_minutes = 1;
// unsigned long range is from 0 to 4,294,967,295 ms or about 1193 hours, 60000 ms = 1 min
unsigned long input_time = input_minutes * 60000;
void setup() {
// put your setup code here, to run once
pinMode(ledPin1, OUTPUT);
pinMode(ledPin2, OUTPUT);
pinMode(ledPin3, OUTPUT);
delay(input_time);
blinkyBlinky3(5, blinkTime);
delay(input_time);
blinkyBlinky2(5, blinkTime);
delay(input_time);
blinkyBlinky1(5, blinkTime);
}
void loop() {
//
}
void blinkyBlinky3(int repeats, int time)
{
for (int i = 0; i < repeats; i++)
{
digitalWrite(ledPin3, HIGH);
delay(time);
digitalWrite(ledPin3, LOW);
delay(time);
}
}
void blinkyBlinky2(int repeats, int time)
{
for(int j = 0; j < repeats; j++) {
digitalWrite(ledPin2, HIGH);
delay(time);
digitalWrite(ledPin2, LOW);
delay(time);
}
}
void blinkyBlinky1(int repeats, int time)
{
for(int k = 0; k < repeats; k++) {
digitalWrite(ledPin1, HIGH);
delay(time);
digitalWrite(ledPin1, LOW);
delay(time);
}
}