Dirrs giving old readings even i am taking new
Hi
I am using servo on boe bot front which moves and have a DIRRS on it. DIRRS sensor takes new distance reading and servo again move. And new reading problem which is coming is that. DIRRS is giving the old reading which are already taken before. What is happening that servo with DIRRS on moves to the right side and i put my hand. Ok then servo moves to middle and suppose to make new reading. What is happening is that its is giving the reading with my hand detected in it.
Why this is happening i had attached my program. How i can fix that help plz.
I am using servo on boe bot front which moves and have a DIRRS on it. DIRRS sensor takes new distance reading and servo again move. And new reading problem which is coming is that. DIRRS is giving the old reading which are already taken before. What is happening that servo with DIRRS on moves to the right side and i put my hand. Ok then servo moves to middle and suppose to make new reading. What is happening is that its is giving the reading with my hand detected in it.
Why this is happening i had attached my program. How i can fix that help plz.
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·Now wanting to learn Spin· Thanks for any·
·
·
·
·
Sam
And please use better grammar and spelling. It's hard to follow what you are asking for.
I had posted the link.
Its the product from HVWtech i think
http://www.solarbotics.com/assets/datasheets/dirrs.pdf
before try to do any thing else
Also here is a link where there are more examples
http://www.hvwtech.com/products_resources.asp?CatID=0&SubCatID=0&SubSubCatID=0&ProductID=91
'{$STAMP BS2} '******************************************** 'HVW TECHNOLOGIES INC. 'DIRRS Plus demo software version 1.0 'Date: March 2000 'Author: Dan Henne 'www.HVWTech.com '******************************************** ' '******************************************** 'This software is used with the DIRRS Plus when it is configured 'for Original DIRRS mode. The input from the DIRRS Plus is 'triggered by a high low transition with the resulting 'distance measurement shifted into the DIST variable. '******************************************** DIST VAR Byte 'Variable used to store DIRRS result T VAR Byte clock CON 1 datain CON 0 OUTPUT clock 'Pin 0 connects to Pin 2 of DIRRS Plus INPUT datain 'Pin 1 connects to Pin 4 of DIRRS Plus START: HIGH clock 'Start Vin must have high-low transition PAUSE 3 'Wait for high to be recognized LOW clock FOR T= 1 TO 30 'Begin 30 ms wait PAUSE 1 IF IN0=1 THEN JUMP 'If Vout is HIGH, measurement is complete -jump NEXT 'Measurement not complete, wait another 1 ms JUMP: SHIFTIN datain,clock,2,[noparse][[/noparse]DIST\8] 'Shift 8 bits into DIST via pin P1, clocking with P0, MSB first DEBUG "Distance= ", DEC DIST,CR 'Display distance (in decimal form) in debug window GOTO START 'Start over
I hope this helps
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·Now wanting to learn Spin· Thanks for any·
·
·
·
·
Sam
While playing with it i am getting problem. Thats why i came here.
Now as far Dist2 and Dist3 routines that is going another story
You might want to try this if different routines
·SHIFTIN datain,clock,2,[noparse][[/noparse]DIST2\8]·
·SHIFTIN datain,clock,2,[noparse][[/noparse]DIST3\8]·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·Now wanting to learn Spin· Thanks for any·
·
·
·
·
Sam
Post Edited (sam_sam_sam) : 4/20/2010 1:22:16 AM GMT
I am just doing that bcoz it is debuging old values when servo moves and its is suppose to take new readings.
To make that simple i just did that to remove that dout.
I think i got the problem.
I think debug is the problem which is making delay in the process.
And in that much time servo is already at other place. So i will try removing the debug. And see what happens. I will post the results.
Ok sam i will also try that what u are saying.
But i dont think that will solve the problem.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
DIRRS have 4 wires One 5 v and other ground. Other 2 Vin and Vout goes to stamp.
Vin is the output pin of microcontroller
Vout is the input pin of microcontroller
Vin to 0
Vout to 1
Post Edited (Sandhuamarinder) : 4/20/2010 7:15:51 AM GMT
Thanks for the help though.
Guess what i am the only one who finished the boe bot race. Boom i got the bonus marks.