Alain,
Wow, works like a charm... now can you tell me how you got to those numbers? <grin>
I'm sure when I install this in the field I will have different numbers, so I will need to know how to recalculate.
You are a lifesaver!
Dave
Alain,
Wow, works like a charm... now can you tell me how you got to those numbers? <grin>
I'm sure when I install this in the field I will have different numbers, so I will need to know how to recalculate.
You are a lifesaver!
Dave
Very simple, Dave ... no miracle !
just need to check what is PBP compatible , as an operation, and avoiding any overflow when calculating ...
Have a look here ...
http://curveexpert.webhop.net/
really a very handy tool
Alain
Last edited by Acetronics2; - 20th August 2010 at 18:43.
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Got the tool. Yes it looks very handy!
Can you tell me the setup you used to calculate the data i sent?
I want to make sure i understand how to set things up
Thanks!
Enter data into “CurveExpert” chart:
X is distance, Y is A/D data
Select ‘Apply Fit”, select ‘Linear” from drop down menu.
A graph will pop up, press the ‘info’ button and you’ll get your equation and the coefficients to use.
I will never admit how long that took me to figure out.
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Hello
This was very interesting. I have a little bit of the same problem.
I have A/D input 0-5V (0-255)
I want a puls out 0V=1mS and 5V=2mS.
If i take your example with the Laser and run it in CurveExpert i got the formula a-bx.
Where did you get 8573 and 41 from, and what is + ( AdResult / 2 ) means?
distance = 8573 + 41*AdResult + ( AdResult / 2 )
Any help will help.
![]()
Hi,
How about:When ADResult is 0 DelayInMicroSeconds is 1000 (1ms), when ADResult is 128 you'll get 1000 + (1280 * 100 / 256) = 1500 and when ADresult is 255 DelayInMicroSeconds is 1000 + (2550 * 100 / 256) = 1996.Code:ADResult = ADResult * 10 DelayInMicroSeconds = 1000 + (ADResult */ 100) PortB.0 = 1 PauseUs DelayInMicroSeconds PortB.0 = 0
It's not perfect but hopefully good enough.
/Henrik.
Bookmarks