-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhideout.ino
More file actions
56 lines (44 loc) · 1.14 KB
/
Copy pathhideout.ino
File metadata and controls
56 lines (44 loc) · 1.14 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
int const potPinLeft = A1,
potPinMiddle = A3,
potPinRight = A5;
int potValLeft,
potValMiddle,
potValRight;
int const LEDPinLeft = 6,
LEDPinMiddle = 5,
LEDPinRight = 3;
int brightnessLeft,
brightnessMiddle,
brightnessRight;
void setup() {
Serial.begin(9600);
pinMode(LEDPinLeft, OUTPUT);
pinMode(LEDPinMiddle, OUTPUT);
pinMode(LEDPinRight, OUTPUT);
}
void loop() {
potValLeft = analogRead(potPinLeft);
potValLeft = analogRead(potPinLeft);
potValMiddle = analogRead(potPinMiddle);
potValMiddle = analogRead(potPinMiddle);
potValRight = analogRead(potPinRight);
potValRight = analogRead(potPinRight);
brightnessLeft = potValLeft/4;
brightnessMiddle = potValMiddle/4;
brightnessRight = potValRight/4;
analogWrite(LEDPinLeft, brightnessLeft);
analogWrite(LEDPinMiddle, brightnessMiddle);
analogWrite(LEDPinRight, brightnessRight);
Serial.println(
"pot: ("+
String(potValLeft)+","+
String(potValMiddle)+","+
String(potValRight)+
"), bright: ("+
String(brightnessLeft)+","+
String(brightnessMiddle)+","+
String(brightnessRight)+
")"
);
delay(15);
}