Skip to content

Commit 3be5247

Browse files
committed
Added E27
1 parent 1640298 commit 3be5247

File tree

6 files changed

+162
-0
lines changed

6 files changed

+162
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
Bas on Tech - Verkeerslicht stap 1
3+
Deze les is onderdeel van de lessen op https://arduino-lessen.nl
4+
5+
(c) Copyright 2020 - Bas van Dijk / Bas on Tech
6+
Deze code en inhoud van de lessen mag zonder schriftelijke toestemming
7+
niet voor commerciele doeleinden worden gebruikt
8+
9+
YouTube: https://www.youtube.com/c/BasOnTechNL
10+
Facebook: https://www.facebook.com/BasOnTechChannel
11+
Instagram: https://www.instagram.com/BasOnTech
12+
Twitter: https://twitter.com/BasOnTech
13+
14+
---------------------------------------------------------------------------
15+
*/
16+
17+
void setup()
18+
{
19+
// Stel pin 8 t/m 10 in als uitvoer
20+
pinMode(8, OUTPUT);
21+
pinMode(9, OUTPUT);
22+
pinMode(10, OUTPUT);
23+
24+
// Zet alle uitvoer op LOW zodat de LED's niet branden
25+
digitalWrite(8, LOW);
26+
digitalWrite(9, LOW);
27+
digitalWrite(10, LOW);
28+
}
29+
30+
void loop()
31+
{
32+
// Rood
33+
digitalWrite(8, HIGH);
34+
delay(5000);
35+
digitalWrite(8, LOW);
36+
37+
// Groen
38+
digitalWrite(10, HIGH);
39+
delay(5000);
40+
digitalWrite(10, LOW);
41+
42+
// Oranje / Geel
43+
digitalWrite(9, HIGH);
44+
delay(1000);
45+
digitalWrite(9, LOW);
46+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
Bas on Tech - Verkeerslicht stap 2
3+
Deze les is onderdeel van de lessen op https://arduino-lessen.nl
4+
5+
(c) Copyright 2020 - Bas van Dijk / Bas on Tech
6+
Deze code en inhoud van de lessen mag zonder schriftelijke toestemming
7+
niet voor commerciele doeleinden worden gebruikt
8+
9+
YouTube: https://www.youtube.com/c/BasOnTechNL
10+
Facebook: https://www.facebook.com/BasOnTechChannel
11+
Instagram: https://www.instagram.com/BasOnTech
12+
Twitter: https://twitter.com/BasOnTech
13+
14+
---------------------------------------------------------------------------
15+
*/
16+
17+
const int PIN_RED = 8;
18+
const int PIN_YELLOW = 9;
19+
const int PIN_GREEN = 10;
20+
21+
void setup()
22+
{
23+
// Stel pin 8 t/m 10 in als uitvoer
24+
pinMode(PIN_RED, OUTPUT);
25+
pinMode(PIN_YELLOW, OUTPUT);
26+
pinMode(PIN_GREEN, OUTPUT);
27+
28+
// Zet alle uitvoer op LOW zodat de LED's niet branden
29+
digitalWrite(PIN_RED, LOW);
30+
digitalWrite(PIN_YELLOW, LOW);
31+
digitalWrite(PIN_GREEN, LOW);
32+
}
33+
34+
void loop()
35+
{
36+
// Rood
37+
digitalWrite(PIN_RED, HIGH);
38+
delay(5000);
39+
digitalWrite(PIN_RED, LOW);
40+
41+
// Groen
42+
digitalWrite(PIN_GREEN, HIGH);
43+
delay(5000);
44+
digitalWrite(PIN_GREEN, LOW);
45+
46+
// Oranje / Geel
47+
digitalWrite(PIN_YELLOW, HIGH);
48+
delay(1000);
49+
digitalWrite(PIN_YELLOW, LOW);
50+
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/*
2+
Bas on Tech - Verkeerslicht stap 3
3+
Deze les is onderdeel van de lessen op https://arduino-lessen.nl
4+
5+
(c) Copyright 2020 - Bas van Dijk / Bas on Tech
6+
Deze code en inhoud van de lessen mag zonder schriftelijke toestemming
7+
niet voor commerciele doeleinden worden gebruikt
8+
9+
YouTube: https://www.youtube.com/c/BasOnTechNL
10+
Facebook: https://www.facebook.com/BasOnTechChannel
11+
Instagram: https://www.instagram.com/BasOnTech
12+
Twitter: https://twitter.com/BasOnTech
13+
14+
---------------------------------------------------------------------------
15+
*/
16+
17+
const int PIN_RED = 8;
18+
const int PIN_YELLOW = 9;
19+
const int PIN_GREEN = 10;
20+
21+
const int DELAY_RED = 5000;
22+
const int DELAY_YELLOW = 1000;
23+
const int DELAY_GREEN = 5000;
24+
25+
void setup()
26+
{
27+
// Stel pin 8 t/m 10 in als uitvoer
28+
pinMode(PIN_RED, OUTPUT);
29+
pinMode(PIN_YELLOW, OUTPUT);
30+
pinMode(PIN_GREEN, OUTPUT);
31+
32+
allOff();
33+
}
34+
35+
void loop()
36+
{
37+
// Rood
38+
digitalWrite(PIN_RED, HIGH);
39+
delay(DELAY_RED);
40+
digitalWrite(PIN_RED, LOW);
41+
42+
// Groen
43+
digitalWrite(PIN_GREEN, HIGH);
44+
delay(DELAY_GREEN);
45+
digitalWrite(PIN_GREEN, LOW);
46+
47+
// Oranje / Geel
48+
digitalWrite(PIN_YELLOW, HIGH);
49+
delay(DELAY_YELLOW);
50+
digitalWrite(PIN_YELLOW, LOW);
51+
}
52+
53+
// Zet alle uitvoer op LOW zodat de LED's niet branden
54+
void allOff()
55+
{
56+
digitalWrite(PIN_RED, LOW);
57+
digitalWrite(PIN_YELLOW, LOW);
58+
digitalWrite(PIN_GREEN, LOW);
59+
}
130 KB
Binary file not shown.
182 KB
Loading

E27-verkeerslicht/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Arduino verkeerslicht
2+
Onderdeel van Bas on Tech Nederlandstalige Arduino lessen - Zie https://arduino-lessen.nl
3+
4+
Abonneer je direct op het Bas on Tech YouTube kanaal via http://www.youtube.com/c/BasOnTechNL?sub_confirmation=1
5+
6+
## De schakeling
7+
![alt text](./E27-verkeerslicht.png "schakel schema")

0 commit comments

Comments
 (0)