Skip to content

Commit

Permalink
Merge pull request #13 from oroca/develop
Browse files Browse the repository at this point in the history
배터리/리모콘 시험 코드 추가
  • Loading branch information
hancheol-cho authored Apr 2, 2019
2 parents b657a51 + a3a73d8 commit fe02b09
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 2 deletions.
7 changes: 6 additions & 1 deletion examples/EduBot_Main/EduBot_Main.ino
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ extern void audio_setup();
extern void audio_loop();
extern void neopixel_setup();
extern void neopixel_loop();

extern void irremote_setup();
extern void irremote_loop();
extern void battery_setup();
extern void battery_loop();

void setup() {
// put your setup code here, to run once:
Expand All @@ -34,6 +37,8 @@ void setup() {
edubot.menuAdd("ToF", tof_setup, tof_loop);
edubot.menuAdd("Audio", audio_setup, audio_loop);
edubot.menuAdd("NeoPixel", neopixel_setup, neopixel_loop);
edubot.menuAdd("IrRemote", irremote_setup, irremote_loop);
edubot.menuAdd("Battery", battery_setup, battery_loop);
}

void loop() {
Expand Down
21 changes: 21 additions & 0 deletions examples/EduBot_Main/src/Battery.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include <EduBot.h>



void battery_setup() {
// put your setup code here, to run once:

edubot.begin(115200);
}

void battery_loop() {
// put your main code here, to run repeatedly
float vol;

edubot.lcd.clearDisplay();
edubot.lcd.printf(0, 0, "Battery Voltage");
vol = edubot.batteryGetVoltage();
edubot.lcd.printf(0, 16,"%1.1f V", vol/10);
edubot.lcd.display();
delay(100);
}
30 changes: 30 additions & 0 deletions examples/EduBot_Main/src/IrRemote.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#include <EduBot.h>



void irremote_setup() {
// put your setup code here, to run once:

edubot.begin(115200);
edubot.tofEnd();
}

void irremote_loop() {
// put your main code here, to run repeatedly

if (edubot.ir_remote.available() > 0)
{
uint32_t key_code;

key_code = edubot.ir_remote.read();

Serial.print("Key : 0x");
Serial.print(key_code, HEX);
Serial.print(" ");
Serial.println(edubot.ir_remote.getTime());
edubot.lcd.clearDisplay();
edubot.lcd.printf(0, 0, "KeyCode");
edubot.lcd.printf(0, 16,"0x%X", key_code);
edubot.lcd.display();
}
}
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=OROCA-EduBot
version=0.0.9
version=0.1.0
author=OROCA
license=Apache-2.0
maintainer=Baram([email protected])
Expand Down

0 comments on commit fe02b09

Please sign in to comment.