-
Notifications
You must be signed in to change notification settings - Fork 0
/
leds.h
59 lines (47 loc) · 1.3 KB
/
leds.h
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
#ifndef LEDS_H
#define LEDS_H
#include <arduino.h>
// Define pin numbers for the LEDs
const int ledPins[] = {A2, A3, A4, A5};
/*
initializeLeds() subroutine intializes analog pins A2,A3,A4,A5
to be used as outputs. Speden Spelit leds are connected to those
pins.
*/
void initializeLeds();
/*
setLed(byte) sets correct led number given as 0,1,2 or 3
led number 0 corresponds to led connected at Arduino pin A2
led number 1 => Arduino pin A3
led number 2 => Arduino pin A4
led number 3 => Arduino pin A5
parameters:
byte ledNumber is 0,1,2 or 3
*/
void setLed(byte ledNumber);
/*
clearAllLeds(void) subroutine clears all leds
*/
void clearAllLeds(void);
/*
setAllLeds subroutine sets all leds
*/
void setAllLeds(void);
/*
Testiohjelma, jolla void setLed(byte), void clearAllLeds(void) ja void setAllLeds(void) aliohjelmien toiminta tulee todistettua
*/
void testiOhjelma(void);
/*
show1() subroutine shows numbers 0,1,...,15 as binary numbers
waits a bit and repeats number "show"
*/
void show1(void);
/*
show2(int) subroutine shows leds 0, 0,1, 0,1,2, 0,1,2,3 with increasing
changing rate per round. And when top change speed has been reached
Parameters:
int rounds: This parameter determines how many times 0,1,2,3 sequence
is shown.
*/
void show2(int);
#endif