Can Sharp GP2D12 proximity sensors be used with Prop chips without additional h
noobmuncher
Posts: 124
Hello,
So I have a few Sharp GP2D12 proximity sensors laying around and also a Digital Infra-Red Rangefinding (DIRRS+) version.
Will both types work with the propeller chip without additional hardware? If so does anyone have code samples that will work with whichever will work?
[noparse]:)[/noparse] Thank you!
So I have a few Sharp GP2D12 proximity sensors laying around and also a Digital Infra-Red Rangefinding (DIRRS+) version.
Will both types work with the propeller chip without additional hardware? If so does anyone have code samples that will work with whichever will work?
[noparse]:)[/noparse] Thank you!
Comments
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
There are several A/D examples on the object exchange http://obex.parallax.com/objects/category/9/
'{$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
John Abshier
Plus, Parallax sells the MCP3208 ADC chip.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Powered by enthusiasm
But my question still remains, if anyone has any ideas for outputting distance to a terminal from a digital sharp sensors (such as this one www.hvwtech.com/products_view.asp?ProductID=91) it would be much appreciated.
This thread from a year ago involved interfacing 24 of the "analog" sharp sensors to the prop via 3 MCP3208's (as SRLM suggested).
http://forums.parallax.com/showthread.php?p=772040
There's code there too
John Abshier