We have two V5 distance sensors (not the ultrasonic ones) that we got shipped in recently, and I am trying to figure out how to get them to work. I have tried many times to get them to work, but I always just get a default value. I feel like I am missing something critical.
This is the simplest version of the code that I am testing the sensors with
(printf doesn’t seem to work on my laptop)
void initialize() {
pros::lcd::initialize();
}
void opcontrol() {
pros::Distance distance_sensor(13);
while(true){
pros::lcd::set_text(5, std::to_string( distance_sensor.get()));
pros::delay(50);
}
}