Skip to content

Commit 7ed5110

Browse files
Mikfbraghiroli
authored andcommitted
Added two examples for the step-up study
1 parent ec3cb2f commit 7ed5110

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
Shows if the SME is running on Battery
3+
4+
created 16 Jun 2015
5+
6+
*/
7+
8+
#include <Arduino.h>
9+
10+
void setup() {
11+
// LED are already initialized by the SME core.
12+
// it is not required to do here
13+
14+
SerialUSB.begin(115200);
15+
}
16+
17+
void loop() {
18+
19+
SerialUSB.print("SmartEverything is running on ");
20+
21+
if (isOnBattery()) {
22+
ledGreenLight(40);
23+
ledRedLight(LOW);
24+
SerialUSB.println("Battery");
25+
} else {
26+
ledGreenLight(LOW);
27+
ledRedLight(40);
28+
SerialUSB.println("external power");
29+
}
30+
31+
delay(2000);
32+
33+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
Shows if the SME is running on Battery
3+
4+
created 16 Jun 2015
5+
6+
*/
7+
8+
#include <Arduino.h>
9+
10+
void setup() {
11+
// LED is already initialized by the SME core.
12+
// it is not required to do here
13+
}
14+
15+
void loop() {
16+
17+
setStepUp(LOW);
18+
ledBlueLight(LOW);
19+
20+
delay(500);
21+
22+
setStepUp(HIGH);
23+
ledBlueLight(40);
24+
delay(200);
25+
26+
}

0 commit comments

Comments
 (0)