Skip to content

Commit 09ece10

Browse files
committed
feat: Add basic hexalamp
1 parent 7b3db98 commit 09ece10

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

hexalamp/hexalamp.ino

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#define ONOFF_PIN 2
2+
#define IRSIG_PIN A0
3+
#define ONOFF_TRH 800
4+
5+
void setup() {
6+
pinMode(ONOFF_PIN, OUTPUT);
7+
pinMode(IRSIG_PIN, INPUT);
8+
}
9+
10+
int av;
11+
12+
void loop() {
13+
av = analogRead(IRSIG_PIN);
14+
15+
16+
if (av <= ONOFF_TRH) {
17+
digitalWrite(ONOFF_PIN, HIGH);
18+
} else {
19+
digitalWrite(ONOFF_PIN, LOW);
20+
}
21+
22+
23+
delay(100);
24+
}

0 commit comments

Comments
 (0)