diff --git a/include/gamepad/screens/defaultScreen.hpp b/include/gamepad/screens/defaultScreen.hpp index 5304d22..9101281 100644 --- a/include/gamepad/screens/defaultScreen.hpp +++ b/include/gamepad/screens/defaultScreen.hpp @@ -16,7 +16,7 @@ class DefaultScreen : public AbstractScreen { void rumble(std::string rumble_pattern); private: - ScreenBuffer currentBuffer{std::nullopt, std::nullopt, std::nullopt, std::nullopt}; + ScreenBuffer currentBuffer; pros::Mutex mut; }; diff --git a/src/gamepad/screens/defaultScreen.cpp b/src/gamepad/screens/defaultScreen.cpp index 30e3212..74a4c49 100644 --- a/src/gamepad/screens/defaultScreen.cpp +++ b/src/gamepad/screens/defaultScreen.cpp @@ -10,17 +10,17 @@ namespace Gamepad { -DefaultScreen::DefaultScreen() : AbstractScreen(1) { +DefaultScreen::DefaultScreen() : AbstractScreen(1), currentBuffer({}) { printf("ran constructor\n"); } ScreenBuffer DefaultScreen::get_screen(std::set visible_lines) { ScreenBuffer output; printf("{%s, %s, %s, %s}\n", - currentBuffer.at(0).value_or("N/A").c_str(), - currentBuffer.at(1).value_or("N/A").c_str(), - currentBuffer.at(2).value_or("N/A").c_str(), - currentBuffer.at(3).value_or("N/A").c_str()); + currentBuffer.at(0).value_or("nullopt").c_str(), + currentBuffer.at(1).value_or("nullopt").c_str(), + currentBuffer.at(2).value_or("nullopt").c_str(), + currentBuffer.at(3).value_or("nullopt").c_str()); // const std::lock_guard guard(this->mut); for (auto i = visible_lines.begin(); i != visible_lines.end(); ++i) { output[*i] = std::move(this->currentBuffer[*i].value_or("")); diff --git a/src/main.cpp b/src/main.cpp index 18f53d0..5f61401 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -62,7 +62,7 @@ void opcontrol() { // Remember to ALWAYS call update at the start of your while loop! Gamepad::master.update(); - // Gamepad::master.print_line(0, "hello\n\nhi"); + Gamepad::master.print_line(0, "hello\n\nhi"); pros::delay(25); // Wait for 25 ms, then update the motor values again }