CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

qtr-8a calibration code?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
yarenler



Joined: 05 Jan 2019
Posts: 8

View user's profile Send private message

qtr-8a calibration code?
PostPosted: Sun Jan 06, 2019 5:22 am     Reply with quote

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: 9221
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sun Jan 06, 2019 6:21 am     Reply with quote

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

View user's profile Send private message

qtr-8a calibration code?
PostPosted: Sun Jan 06, 2019 3:00 pm     Reply with quote

temtronic, thanks for your comment.
I am trying everything. It isn't yet. I hope i will do it. bye
_________________
esen_seher_yeller
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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