Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read and set calibration value #11

Closed
Agents007 opened this issue May 3, 2023 · 6 comments
Closed

Read and set calibration value #11

Agents007 opened this issue May 3, 2023 · 6 comments

Comments

@Agents007
Copy link

No description provided.

@DavidEGrayson
Copy link
Member

see calibrationOn and calibrationOff

@Agents007
Copy link
Author

Agents007 commented May 3, 2023 via email

@DavidEGrayson
Copy link
Member

DavidEGrayson commented May 3, 2023

What exactly do you mean? What have you already tried and why did it not work?

@Agents007
Copy link
Author

Agents007 commented May 3, 2023 via email

@DavidEGrayson
Copy link
Member

First of all, look at the definition of struct CalibrationData in QTRSensors.h so you know what data that struct contains. Then use the C++ assignment operator (=) to set the values of each member. For examples:

sensors.calibrationOn.initialized = true;
sensors.calibrationOn.minimum = your_array_of_minima;
sensors.calibrationOn.maximum = your_array_of_maxima;

This seems like a general C++ programming question. We use GitHub issues to keep track of bugs and feature requests in the library, so if you need more help the more appropriate place to ask would be:

https://forum.pololu.com

@DavidEGrayson
Copy link
Member

Note: the destructor of QTRSensors uses free to free those arrays, so you should either allocate your arrays yourself with malloc or by calling QTRSensors::calibrate (and then overwriting the values it stores in the newly-allocated arrays).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants