One way...
Inside main() read the ADC1 and store the value into a variable called 'initial_ADC1_value.
Then in your 'read and compare' loop(), read the ADC1 and store into a second variable called 'current_ADC1_value'.
Then compare the two variables using an If(.....) statement.
Also...
do NOT use floating point if you expect FAST results ! FP number crunching is very,very slow on PICs.It's far faster to use 'raw' int16 numbers or 'scaled' int16 numbers.
also...
press F11 while your program is open, and you'll get the CCS Help files up! Makes it easy to lookup almost anything code related!!
hth
jay
rdevendrakumar1989
Joined: 13 Jun 2013 Posts: 5 Location: India
Thank you
Posted: Thu Oct 10, 2013 5:50 am
Thank you for your kind reply.. Definitely i will do...
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