Rock Monitoring  V 1.0
Leds.cpp
Go to the documentation of this file.
1 #include "Leds.h"
6 {
7 }
9 void Leds::init()
10 {
11  pinMode(DIGITAL1 ,OUTPUT); //Led green
12  pinMode(DIGITAL2 ,OUTPUT); //Led green on Button
13 
14  //clear both Leds
15  LedGreenOff();
16  LedButtonOff();
17 }
20 {
21  digitalWrite(DIGITAL1, HIGH);
22 }
25 {
26  digitalWrite(DIGITAL1, LOW);
27 }
30 {
31  digitalWrite(DIGITAL2, HIGH);
32 }
35 {
36  digitalWrite(DIGITAL2, LOW);
37 }
38 
41 {
42  LedGreenOn();
43  delay(300);
44  LedGreenOff();
45 }
48 {
49  LedButtonOn();
50  delay(300);
51  LedButtonOff();
52 }
55 {
56  LedGreenOn();
57  LedButtonOn();
58  delay(300);
59  LedButtonOff();
60  LedGreenOff();
61 }
62 
65 {
66 
67  for(uint8_t i = 0; i<4; i++)
68  {
70  delay(700);
71  }
72 }
75 void Leds::BlinkAkku(uint8_t batLevel)
76 {
77  if(batLevel >= 80)
78  {
79  LedButtonOn();
80  delay(5000);
81  LedButtonOff();
82  }
83  else if(batLevel >=40)
84  {
85  for(uint8_t i = 0; i<5; i++)
86  {
87  LedButtonOn();
88  delay(500);
89  LedButtonOff();
90  delay(500);
91  }
92  }
93  else
94  {
95  for(uint8_t i = 0; i<5; i++)
96  {
97  LedButtonOn();
98  delay(100);
99  LedButtonOff();
100  delay(900);
101  }
102  }
103 
104 
105 }
106 
void BlinkAkku(uint8_t batLevel)
This method sets the button led on or in blink state for 5 seconds (depending on battery level) (bloc...
Definition: Leds.cpp:75
void LedButtonBlinkOnce()
This method lets the led on the button blink once (blocks program for 300ms)
Definition: Leds.cpp:47
void LedButtonOff()
This method turns the led on the button off.
Definition: Leds.cpp:34
void init()
This method initializes the output pins for the leds and clears both led.
Definition: Leds.cpp:9
void LedButtonOn()
This method turns the led on the button on.
Definition: Leds.cpp:29
void LedGreenOn()
This method turns the green led on.
Definition: Leds.cpp:19
void LedGreenOff()
This method turns the green led off.
Definition: Leds.cpp:24
Leds()
Definition: Leds.cpp:5
void LedGreenBlink4seconds()
This method lets the green led blink for 4 seconds (blocks program for 4s)
Definition: Leds.cpp:64
void LedGreenBlinkOnce()
This method lets the green led blink once (blocks program for 300ms)
Definition: Leds.cpp:40
void BothBlinkOnce()
This method lets both leds blink once (blocks program for 300ms)
Definition: Leds.cpp:54