My header file defines a string to represent the left front motor of the site.
Establishing constructor error reporting.
If I don’t want to “use namespace pros:: literals;”
What should we do?
My header file defines a string to represent the left front motor of the site.
Establishing constructor error reporting.
If I don’t want to “use namespace pros:: literals;”
What should we do?
Here’s an example:
#include "main.h"
using namespace pros::literals;
void opcontrol() {
pros::Controller master(pros::E_CONTROLLER_MASTER);
pros::Motor left_motor = 1_mtr; // basic usage
auto right_mtr = 2_mtr; // could also take advantage of the "auto" keyword
while (true) {
int left = master.get_analog(ANALOG_LEFT_Y);
int right = master.get_analog(ANALOG_RIGHT_Y);
left_motor = left;
right_mtr = right;
3_mtr = left; // could also take advantage of literal and the operator overloading
(4_mtr).move_voltage(right); // you can also call functions on the literal
pros::delay(20);
}
}
thank you .but i want to save “1_mtr” to sd Card.
because my brain’s usb port is broken…
i read “std::string” data form sd card.
how to change “std::string” to “pros::literals”
and i don’t like using namespace;
what should i do?
That’s not the way C++ literals work. You’ll need to look to tackle your problem a different way. If your brain’s USB port is broken, you should contact VEX Support to get that working as wireless download isn’t yet supported and you won’t have a way to update firmware.