display battery power - change min/max speed

master
jblb 6 years ago
parent 72f11e1d73
commit a47f055f4e

@ -19,8 +19,8 @@ framework = arduino
platform = atmelavr
lib_deps =
Nintendo Extension Ctrl
upload_port = /dev/ttyACM*
monitor_port = /dev/ttyACM*
upload_port = /dev/ttyACM*
; [env:pro_micro]
@ -46,7 +46,7 @@ platform = ststm32
framework = arduino
board = nucleo_l031k6
build_flags =
-Wno-deprecated
-Wno-deprecated
lib_deps =
Nintendo Extension Ctrl

@ -145,7 +145,9 @@ void Send(int16_t uSteer, int16_t uSpeed)
// ########################## RECEIVE ##########################
void Receive()
{
int old_cursorX, old_cursorY;
// Check for new data availability in the Serial buffer
if (Serial1.available()) {
incomingByte = Serial1.read(); // Read the incoming byte
@ -205,6 +207,16 @@ void Receive()
Serial.print(" 8: ");
Serial.println(Feedback.boardTemp);
}
display.setCursor(0, 30);
display.setTextSize(1); // Draw 1X-scale text
display.setTextColor(SSD1306_WHITE);
display.print("V : ");
old_cursorX = display.getCursorX();
old_cursorY = display.getCursorY();
display.fillRect(old_cursorX, old_cursorY, (6 * 5), 8, SSD1306_BLACK); // erase previous display
display.setCursor(old_cursorX, old_cursorY);
display.print(Feedback.batVoltage);
display.display();
} else {
if (Serial)
Serial.println("Non-valid data skipped");
@ -224,8 +236,8 @@ int old_cursorX, old_cursorY;
nchuk.reconnect();
} else {
cmd1 = map(nchuk.joyX(),0,256,-300,300); // x - axis. Nunchuck joystick readings range 30 - 230
cmd2 = map(nchuk.joyY(),0,256, 300, -300); // y - axis
cmd1 = map(nchuk.joyX(),0,256,150,-150); // x - axis. Nunchuck joystick readings range 30 - 230
cmd2 = map(nchuk.joyY(),0,256,-150,150); // y - axis
}
display.setCursor(0, 40);
display.setTextSize(1); // Draw 1X-scale text

Loading…
Cancel
Save