|
|
View previous topic :: View next topic |
Author |
Message |
yarenler
Joined: 05 Jan 2019 Posts: 8
|
qtr-8a calibration code? |
Posted: Sun Jan 06, 2019 5:22 am |
|
|
Hi friends, how to write the calibration code of the qtr-8a sensor ?
I find and store the highest and lowest values of the sensors. But these values of the sensors are not the same. For example, the value of a sensor is at least 58 and the other is 55. For each sensor, we write the code where the minimum value is equal to 0 and the maximum value is equal to 1023. _________________ esen_seher_yeller |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9245 Location: Greensville,Ontario
|
|
Posted: Sun Jan 06, 2019 6:21 am |
|
|
You need to create 2 16bit arrays big enough to hold the number of sensors.
something like..
//
...
//create arrays for 3 sensors, prefill with max opposite data
unsigned int16 sensor_minimum_values[3]= {1023,1023,1023};
unsigned int16 sensor_mximum_values[3}={0,0,0};
//
Now create a calibration routine, where inside a loop, you read a sensor, test if the reading is smaller than the min value, if so store the adc reading. Test if the reading is bigger than the max value, if so store the adc reading.
You'll have to decide how to 'run the test', perhaps a 5 second loop per sensor, with an LED to flash when done to tell you to test the next sensor. Obviously an LCD would be great to use, couple of pushbuttons for control.
I'm sure Google will find some code you can easily modify for your purpose.
Jay |
|
|
yarenler
Joined: 05 Jan 2019 Posts: 8
|
qtr-8a calibration code? |
Posted: Sun Jan 06, 2019 3:00 pm |
|
|
temtronic, thanks for your comment.
I am trying everything. It isn't yet. I hope i will do it. bye _________________ esen_seher_yeller |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|