Lynxmotion Tech Support

www.lynxmotion.com
It is currently Sun May 19, 2013 7:43 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: help with IR sensor
PostPosted: Wed Jan 31, 2007 2:24 pm 
Offline
Robot Guru
User avatar

Joined: Tue Nov 28, 2006 5:47 pm
Posts: 1252
Location: Mars!!!
i have just received my gp2d12 ir sensor
and i don't know how to hook it up to the mini atom bot board
onto the analog I/O's
for the basic atom :?: :?: :?:

_________________
Decode this secret ASCII message:
$52 $4F $54 $46 $4C $4F $4C

*Avatar is me after I laughed out loud too much.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 31, 2007 3:00 pm 
Offline
Roboteer

Joined: Sat Dec 10, 2005 12:06 am
Posts: 117
Location: Closer than once thought
Page 5 should help you out.


http://www.lynxmotion.com/images/data/abbpdf02.pdf


:twisted:

_________________
When in doubt whip it out!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 31, 2007 3:12 pm 
Offline
Robot Guru
User avatar

Joined: Tue Nov 28, 2006 5:47 pm
Posts: 1252
Location: Mars!!!
thank's
but now the sensor isn't responding
when i put my hand in front of it

is there a programming error?

Code:

'variable definitions
mid var word
left var word
right var word
right_detect var word
left_detect var word
middle_detect var word


left = -1000
mid = 1500
right = 1000



low p0

sound 9,[100\880, 100\988,100\1046,100\1175]         

pause 1000                          'wait one second

main:
 
 gosub a2d_check                          'get the IR information
   
    left_detect = left_detect/10       
  right_detect = right_detect/10
  middle_detect = middle_detect/10
 
 left=(left - 5) min 1325
 right=(right - 5) min 1325
 
 mid =(mid - 5) min 1425
 
 left = (left + left_detect) max 1725
 right = (right + right_detect) max 1725
 mid = (mid + middle_detect) max 1525
 
 if mid <15 then skip
  left =  (left - middle_detect) max 1325
  right = (right - middle_detect) max 1325
skip:
servo 0,left          'turn sensor left
servo 0,mid         'turn sensor right
servo 0,right          'return to middle position
pause 20

a2d_check:
adin ax2,0,AD_RON, right_detect
adin ax2,0,AD_RON,middle_detect
adin ax2,0,AD_RON,left_detect
return
goto main


_________________
Decode this secret ASCII message:
$52 $4F $54 $46 $4C $4F $4C

*Avatar is me after I laughed out loud too much.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 31, 2007 3:25 pm 
Offline
Robot Guru

Joined: Fri Jun 16, 2006 3:51 pm
Posts: 1003
Location: New York, USA
Look at one of chunga's threads on the IR sensor. He bought one a few weeks ago and posted some code he used I believe.

_________________
What do you mean "NO SPOON!"????


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 31, 2007 3:28 pm 
Offline
Robot Guru
User avatar

Joined: Sun Aug 27, 2006 11:26 pm
Posts: 2757
Location: Directly above the center of the Earth
robodude666 wrote:
Look at one of chunga's threads on the IR sensor. He bought one a few weeks ago and posted some code he used I believe.


I've also written good code to handle the Sharp IR sensors as well as the IRPD.

8-Dale

_________________
I can usually handle complexity. It's the simple things that always confound me..
Open your mind, Read, Learn, Think, Apply..


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 31, 2007 3:28 pm 
Offline
Robot Guru
User avatar

Joined: Tue Nov 28, 2006 5:47 pm
Posts: 1252
Location: Mars!!!
where?

_________________
Decode this secret ASCII message:
$52 $4F $54 $46 $4C $4F $4C

*Avatar is me after I laughed out loud too much.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 31, 2007 3:36 pm 
Offline
Robot Guru
User avatar

Joined: Sun Aug 27, 2006 11:26 pm
Posts: 2757
Location: Directly above the center of the Earth
wowy7 wrote:
where?


Go to my website and look for Rovers-->W.A.L.T.E.R.-->Software and download the latest version (bottom of the page).

8-Dale

_________________
I can usually handle complexity. It's the simple things that always confound me..
Open your mind, Read, Learn, Think, Apply..


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 31, 2007 6:52 pm 
Offline
Robot Guru
User avatar

Joined: Tue Nov 28, 2006 5:47 pm
Posts: 1252
Location: Mars!!!
is it for the gp2d12?
and if so, is it only for one?

_________________
Decode this secret ASCII message:
$52 $4F $54 $46 $4C $4F $4C

*Avatar is me after I laughed out loud too much.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 31, 2007 8:02 pm 
Offline
Robot Guru
User avatar

Joined: Sun Aug 27, 2006 11:26 pm
Posts: 2757
Location: Directly above the center of the Earth
wowy7 wrote:
is it for the gp2d12?
and if so, is it only for one?


Read the comments in the program. All the your questions are answered there. :D:D I have comments on nearly every line of code or each major section and subroutine.

8-Dale

_________________
I can usually handle complexity. It's the simple things that always confound me..
Open your mind, Read, Learn, Think, Apply..


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 17, 2008 12:41 pm 
Offline
Roboteer

Joined: Tue Feb 05, 2008 6:33 pm
Posts: 129
this page url is invald
is it somewere else?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 17, 2008 1:52 pm 
Offline
Lynxmotion Founder
User avatar

Joined: Mon Oct 31, 2005 10:46 am
Posts: 9325
Location: my quiet place
Bane wrote:
this page url is invald
is it somewere else?


Which page?

_________________
Jim Frye, the Robot Guy
http://www.lynxmotion.com
I've always tried to do my best...


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 17, 2008 3:38 pm 
Offline
Roboteer

Joined: Tue Feb 05, 2008 6:33 pm
Posts: 129
Quote:
wowy7 wrote:
where?


Go to my website and look for Rovers-->W.A.L.T.E.R.-->Software and download the latest version (bottom of the page).



Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 17, 2008 3:44 pm 
Offline
Lynxmotion Founder
User avatar

Joined: Mon Oct 31, 2005 10:46 am
Posts: 9325
Location: my quiet place
Huh, dunno...

_________________
Jim Frye, the Robot Guy
http://www.lynxmotion.com
I've always tried to do my best...


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 17, 2008 3:55 pm 
Offline
Roboteer

Joined: Tue Feb 05, 2008 6:33 pm
Posts: 129
oh well, im really having trouble finding working code for my GP2D12 thats all.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 17, 2008 4:11 pm 
Offline
Lynxmotion Founder
User avatar

Joined: Mon Oct 31, 2005 10:46 am
Posts: 9325
Location: my quiet place
This program will make a sound that raises in pitch the closer you hold your hand to the sensor. The IR sensor would be plugged into the AX0 pin on the Bot Board.

Code:
irvariable var word
loopit:
adin 0, irvariable
sound 9,[10\(ir * 10)
goto loopit

_________________
Jim Frye, the Robot Guy
http://www.lynxmotion.com
I've always tried to do my best...


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: Bing [Bot] and 1 guest


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group