mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
Ion.battery() return a float with the current battery voltage TODO : Update the translation of the toolbox (only FR and EN currently)
18 lines
480 B
C++
18 lines
480 B
C++
extern "C" {
|
|
#include "modion.h"
|
|
#include <py/objtuple.h>
|
|
#include <py/runtime.h>
|
|
}
|
|
#include <ion.h>
|
|
#include "port.h"
|
|
|
|
mp_obj_t modion_keyboard_keydown(mp_obj_t key_o) {
|
|
Ion::Keyboard::Key key = static_cast<Ion::Keyboard::Key>(mp_obj_get_int(key_o));
|
|
Ion::Keyboard::State state = Ion::Keyboard::scan();
|
|
micropython_port_interrupt_if_needed();
|
|
return mp_obj_new_bool(state.keyDown(key));
|
|
}
|
|
|
|
mp_obj_t modion_battery() {
|
|
return mp_obj_new_float(Ion::Battery::voltage());
|
|
} |