.
Dependents: Konstrukcijski_Blazevic kontrola_ulaza_IF
Ledica.cpp@1:aa26b9c6dc15, 2021-05-07 (annotated)
- Committer:
- ifluka
- Date:
- Fri May 07 08:44:05 2021 +0000
- Revision:
- 1:aa26b9c6dc15
- Parent:
- 0:b3bc716e5bea
a
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
MarioBlazevic | 0:b3bc716e5bea | 1 | #include "Ledica.h" |
MarioBlazevic | 0:b3bc716e5bea | 2 | #include "mbed.h" |
ifluka | 1:aa26b9c6dc15 | 3 | Indicator::Indicator(PinName lightPin) : light(lightPin) { |
ifluka | 1:aa26b9c6dc15 | 4 | |
ifluka | 1:aa26b9c6dc15 | 5 | } |
MarioBlazevic | 0:b3bc716e5bea | 6 | |
ifluka | 1:aa26b9c6dc15 | 7 | void Indicator::light_on(int t, int v1, int v2) { |
MarioBlazevic | 0:b3bc716e5bea | 8 | |
ifluka | 1:aa26b9c6dc15 | 9 | if(t>=v1 && t<v2) |
ifluka | 1:aa26b9c6dc15 | 10 | light=1; |
ifluka | 1:aa26b9c6dc15 | 11 | wait(0.00001); |
ifluka | 1:aa26b9c6dc15 | 12 | light=0; |
ifluka | 1:aa26b9c6dc15 | 13 | } |