no suitable constructor exists to convert from “int” to “units::unit_t<units::time::second, double, units::linear_scale>”
Any suggestions? I have about 15 of these errors.
no suitable constructor exists to convert from “int” to “units::unit_t<units::time::second, double, units::linear_scale>”
Any suggestions? I have about 15 of these errors.
What function is giving that error?
Probably a function prototype changed.
Check the Java API documentation.
We’re using C++ and the following function:
frc::Counter::SetMaxPeriod(int)
Wait(0.002)
It seems there is something wrong with the Counter and Timer Class; however, I can’t pinpoint it
Did you read the changelog? There were a ton of changes for this year, so more support for the Units API would not surprise me at all.
Many C++ methods migrated to using “units” instead of int/double.
I’d look into that.
Maybe your parameter need to have another type or be explicitly casted into the unit.
You will have to learn to use the C++ units library.
As Oblarg pointed out, Timer switched to using units in C++. To make your line of code work, it needs to be Wait(0.002_s)
(or Wait(2_ms)
) rather than Wait(0.002)
Awesome, thank you! Fixed the Issue instantly!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.