Sign in

username:

password:



Not a member?

Search oopic



Search tips

Subscribe to oopic



Ads

Discussion Groups

Discussion Groups | | Sharp GP2D12

Sharp GP2D12 - Mike Martin - Apr 13 7:30:39 2008

Hello All (newbie question)
I'd like to ask two things.
1)Is the diagram on http://www.oopic.com/gp2d12.htm wrong? The
datasheet in the sensors & detectors folder in the files section have
the pinout different to that on the oopic site (as well as the wiring
colours). If I look at mine face-on, from left to right the wiring is
yellow/black/red for Vo/GND/Voc but the website suggests GND/Voc/Vc.
So you see, I'm having trouble figuring out if it even works.
2)Also, does someone have a code snippet (or a known working diagram)
I could borrow to test it? I'm not entirely sure what to read from
the IO line. What does IR.Value produce? So far all I can get out of
it is an integer value of 46. I'm using B.1.0 firmware. How can a
digital IOline read fluctuating voltages? Is it converted to varying
pulses? The code I'm using is below:

'Turns on a RED LED - fishing for a value out of the IR
Sub main()
Red.IOLine = 1
IR.IOLine = 3
Red.Value = 0
ooPIC.ExtVRef=0
IR.Operate=cvTrue
X = IR.Value
If X = 46 Then 'discovered this value by trial and error
Red.TurnOn
End If
Delay = 1000
Red.TurnOff
End Sub
------------------------------------



(You need to be a member of oopic -- send a blank email to oopic-subscribe@yahoogroups.com )


Re: Sharp GP2D12 - rtstofer - Apr 13 11:10:07 2008

--- In o...@yahoogroups.com, "Mike Martin" wrote:
>
> Hello All (newbie question)
> I'd like to ask two things.
> 1)Is the diagram on http://www.oopic.com/gp2d12.htm wrong? The
> datasheet in the sensors & detectors folder in the files section have
> the pinout different to that on the oopic site (as well as the wiring
> colours). If I look at mine face-on, from left to right the wiring is
> yellow/black/red for Vo/GND/Voc but the website suggests GND/Voc/Vc.
> So you see, I'm having trouble figuring out if it even works.
> 2)Also, does someone have a code snippet (or a known working diagram)
> I could borrow to test it? I'm not entirely sure what to read from
> the IO line. What does IR.Value produce? So far all I can get out of
> it is an integer value of 46. I'm using B.1.0 firmware. How can a
> digital IOline read fluctuating voltages? Is it converted to varying
> pulses? The code I'm using is below:
>
> 'Turns on a RED LED - fishing for a value out of the IR
> Sub main()
> Red.IOLine = 1
> IR.IOLine = 3
> Red.Value = 0
> ooPIC.ExtVRef=0
> IR.Operate=cvTrue
> X = IR.Value
> If X = 46 Then 'discovered this value by trial and error
> Red.TurnOn
> End If
> Delay = 1000
> Red.TurnOff
> End Sub
>

Try this: http://www.acroname.com/examples/10012/10012.html

If you assign analog signals to IOLines 1..4 then all of them set to
analog. Similarly if you assign analog signals to IOLines 5..7 then
all of IOLines 1..7 are analog inputs. If you read them as a digital
input, you will get 0.

As a general guide: assign analog signals to IOLines 1..7, digital
inputs to IOLines 8..15 (you can use OOPic.PullUp = cvOn to use the
internal pull-up resistors) and digital outputs to IOLines 16 and up.
This is just a guide, not an absolute requirement.
Ignore the wiring on the OOPic page, it is wrong. There is a
datasheet here:
http://www.acroname.com/robotics/parts/SharpGP2D12-15.pdf The pinout
is correct, be definition. Most web sites just make an approximation
- Acroname is correct, top to bottom, but show the connector
generically on the wrong side of the 'box'.

Looking at my MiniSumo, with the connector to the right, the wires are
red, black, yellow, to to bottom, which matches the datasheet and the
intent of the Acroname sketch.

Richard

------------------------------------



(You need to be a member of oopic -- send a blank email to oopic-subscribe@yahoogroups.com )

Re: Sharp GP2D12 - tinslwc - Apr 13 11:17:27 2008

Mike,
I have used a GP2D15 (a digital output for specific distance) but the
datasheet that I have has the 12 and 15. Looking on the top of the
sensor, pins facing toward you, sensor facing away from you, the pins
are Vo, Gnd, Vcc. If you have a multimeter, you can connect +5 to
Vcc, Ground to Ground and read the output (Vo) with you meter with
respect to ground. You should see approximatly 2.5V with an object
about 10 cm away from the sensor and as you move the object away, the
voltage shoud decay. According to my data sheet (and IR knowledge)
you need to have a reflective object in order to get the sensor to
work. A white sheet of paper should work fine. There does appear to
be some ripple in the output waveform. A small capacitor from the
signal line to ground should clean this up. I would recommend
something on the order of ~0.01uF. Use a ceramic cap, not
electrolytic. If you would like the schematic/picture of what I
used, let me know and I will get one to you. Again, I was using the
15, not the 12 but the pinouts are the same.
-Bill
--- In o...@yahoogroups.com, "Mike Martin" wrote:
>
> Hello All (newbie question)
> I'd like to ask two things.
> 1)Is the diagram on http://www.oopic.com/gp2d12.htm wrong? The
> datasheet in the sensors & detectors folder in the files section
have
> the pinout different to that on the oopic site (as well as the
wiring
> colours). If I look at mine face-on, from left to right the wiring
is
> yellow/black/red for Vo/GND/Voc but the website suggests
GND/Voc/Vc.
> So you see, I'm having trouble figuring out if it even works.
> 2)Also, does someone have a code snippet (or a known working
diagram)
> I could borrow to test it? I'm not entirely sure what to read from
> the IO line. What does IR.Value produce? So far all I can get out
of
> it is an integer value of 46. I'm using B.1.0 firmware. How can a
> digital IOline read fluctuating voltages? Is it converted to
varying
> pulses? The code I'm using is below:
>
> 'Turns on a RED LED - fishing for a value out of the IR
> Sub main()
> Red.IOLine = 1
> IR.IOLine = 3
> Red.Value = 0
> ooPIC.ExtVRef=0
> IR.Operate=cvTrue
> X = IR.Value
> If X = 46 Then 'discovered this value by trial and error
> Red.TurnOn
> End If
> Delay = 1000
> Red.TurnOff
> End Sub
>

------------------------------------



(You need to be a member of oopic -- send a blank email to oopic-subscribe@yahoogroups.com )

Re: Sharp GP2D12 - ooPIC Tech Support - Apr 13 17:05:24 2008

When in doubt, believe the manufacturer - Mistakes creep into anyone
else's documentation.

DLC

Mike Martin wrote:
> Hello All (newbie question)
> I'd like to ask two things.
> 1)Is the diagram on http://www.oopic.com/gp2d12.htm wrong? The
> datasheet in the sensors & detectors folder in the files section have
> the pinout different to that on the oopic site (as well as the wiring
> colours). If I look at mine face-on, from left to right the wiring is
> yellow/black/red for Vo/GND/Voc but the website suggests GND/Voc/Vc.
> So you see, I'm having trouble figuring out if it even works.
> 2)Also, does someone have a code snippet (or a known working diagram)
> I could borrow to test it? I'm not entirely sure what to read from
> the IO line. What does IR.Value produce? So far all I can get out of
> it is an integer value of 46. I'm using B.1.0 firmware. How can a
> digital IOline read fluctuating voltages? Is it converted to varying
> pulses? The code I'm using is below:
>
> 'Turns on a RED LED - fishing for a value out of the IR
> Sub main()
> Red.IOLine = 1
> IR.IOLine = 3
> Red.Value = 0
> ooPIC.ExtVRef=0
> IR.Operate=cvTrue
> X = IR.Value
> If X = 46 Then 'discovered this value by trial and error
> Red.TurnOn
> End If
> Delay = 1000
> Red.TurnOff
> End Sub
> ------------------------------------



(You need to be a member of oopic -- send a blank email to oopic-subscribe@yahoogroups.com )

Re: Sharp GP2D12 - Mike Martin - Apr 14 6:32:37 2008

Woo Hoo! I've got volts that go up and down! (Thanks Bill). So how do
I calibrate it and translate volts into something meaningful though
the OOPic?

--- In o...@yahoogroups.com, "tinslwc" wrote:
>
> Mike,
> I have used a GP2D15 (a digital output for specific distance) but
the
> datasheet that I have has the 12 and 15. Looking on the top of
the
> sensor, pins facing toward you, sensor facing away from you, the
pins
> are Vo, Gnd, Vcc. If you have a multimeter, you can connect +5 to
> Vcc, Ground to Ground and read the output (Vo) with you meter with
> respect to ground. You should see approximatly 2.5V with an object
> about 10 cm away from the sensor and as you move the object away,
the
> voltage shoud decay. According to my data sheet (and IR knowledge)
> you need to have a reflective object in order to get the sensor to
> work. A white sheet of paper should work fine. There does appear
to
> be some ripple in the output waveform. A small capacitor from the
> signal line to ground should clean this up. I would recommend
> something on the order of ~0.01uF. Use a ceramic cap, not
> electrolytic. If you would like the schematic/picture of what I
> used, let me know and I will get one to you. Again, I was using
the
> 15, not the 12 but the pinouts are the same.
> -Bill
> --- In o...@yahoogroups.com, "Mike Martin" wrote:
> >
> > Hello All (newbie question)
> > I'd like to ask two things.
> > 1)Is the diagram on http://www.oopic.com/gp2d12.htm wrong? The
> > datasheet in the sensors & detectors folder in the files section
> have
> > the pinout different to that on the oopic site (as well as the
> wiring
> > colours). If I look at mine face-on, from left to right the
wiring
> is
> > yellow/black/red for Vo/GND/Voc but the website suggests
> GND/Voc/Vc.
> > So you see, I'm having trouble figuring out if it even works.
> > 2)Also, does someone have a code snippet (or a known working
> diagram)
> > I could borrow to test it? I'm not entirely sure what to read
from
> > the IO line. What does IR.Value produce? So far all I can get out
> of
> > it is an integer value of 46. I'm using B.1.0 firmware. How can a
> > digital IOline read fluctuating voltages? Is it converted to
> varying
> > pulses? The code I'm using is below:
> >
> > 'Turns on a RED LED - fishing for a value out of the IR
> > Sub main()
> > Red.IOLine = 1
> > IR.IOLine = 3
> > Red.Value = 0
> > ooPIC.ExtVRef=0
> > IR.Operate=cvTrue
> > X = IR.Value
> > If X = 46 Then 'discovered this value by trial and error
> > Red.TurnOn
> > End If
> > Delay = 1000
> > Red.TurnOff
> > End Sub
>
------------------------------------



(You need to be a member of oopic -- send a blank email to oopic-subscribe@yahoogroups.com )

Re: Sharp GP2D12 - Mike Martin - Apr 14 7:09:07 2008

Hi Richard and thanks.I'm using real circuits and components on a
prototyping board (ie not virtual circuits). Would it be easier just to
use virtual circuits? I take it that because the sensor outputs a
varying voltage it's an analog output?

> If you assign analog signals to IOLines 1..4 then all of them set to
> analog.

If I put a (real) wire from IOLine 1 onto the Vo line of the sensor and
the assign it

Dim IR as New oA2D
IR.IOLine = 1

then can I do something with IR.Value? Say switch on an LED at some
threshold? I did what Bill suggested and put it on a multimeter and
measured Vo with respect to GND and got varying values, so I know the
sensor works.

Mike M.
------------------------------------



(You need to be a member of oopic -- send a blank email to oopic-subscribe@yahoogroups.com )

Re: Sharp GP2D12 - rtstofer - Apr 14 10:54:58 2008

--- In o...@yahoogroups.com, "Mike Martin" wrote:
>
> Hi Richard and thanks.I'm using real circuits and components on a
> prototyping board (ie not virtual circuits). Would it be easier just to
> use virtual circuits? I take it that because the sensor outputs a
> varying voltage it's an analog output?

The virtual circuit is kind of like an internal wiring scheme. Your
sensor might go to an oA2D to convert the value, then to an oCompare
connected by an oWire to an oEvent. Well, there is no physical
connection so it is called a virtual circuit.

>
> > If you assign analog signals to IOLines 1..4 then all of them set to
> > analog.
>
> If I put a (real) wire from IOLine 1 onto the Vo line of the sensor and
> the assign it
>
> Dim IR as New oA2D
> IR.IOLine = 1

Right. Just do your digital outputs on IOLines higher than 4 in this
case. If you wind up with analog signals on IOLines 5..7 then digital
signals must be on IOLines higher than 7.

>
> then can I do something with IR.Value? Say switch on an LED at some
> threshold?

That is probably exactly what you want to do. You might use oCompare
to test against a setpoint. Connect the .Above, .Below or .Between
output to an oWire Input.Link and use the oWire Output.Link to trigger
an oEvent. This oEvent thing won't work on V6 and C.1.1+ until the
next version of the compiler is released. Search the archive here for
a discussion of how to work around the problem.

> I did what Bill suggested and put it on a multimeter and
> measured Vo with respect to GND and got varying values, so I know the
> sensor works.
>
> Mike M.
>

Richard

------------------------------------



(You need to be a member of oopic -- send a blank email to oopic-subscribe@yahoogroups.com )

Re: Re: Sharp GP2D12 - ooPIC Tech Support - Apr 14 14:21:16 2008



Mike Martin wrote:
> Woo Hoo! I've got volts that go up and down! (Thanks Bill). So how do
> I calibrate it and translate volts into something meaningful though
> the OOPic?
>
>
Meaningful to whom? :) Look at the Sharp data sheet to get the
values and what their range represents. I myself don't translate them
at all. I find the value for the range that I'm interested in and let
the robot deal with it that way - A robot doesn't care if its inches,
fathoms or furlongs.

DLC
> --- In o...@yahoogroups.com, "tinslwc" wrote:
>
>> Mike,
>> I have used a GP2D15 (a digital output for specific distance) but
>>
> the
>
>> datasheet that I have has the 12 and 15. Looking on the top of
>>
> the
>
>> sensor, pins facing toward you, sensor facing away from you, the
>>
> pins
>
>> are Vo, Gnd, Vcc. If you have a multimeter, you can connect +5 to
>> Vcc, Ground to Ground and read the output (Vo) with you meter with
>> respect to ground. You should see approximatly 2.5V with an object
>> about 10 cm away from the sensor and as you move the object away,
>>
> the
>
>> voltage shoud decay. According to my data sheet (and IR knowledge)
>> you need to have a reflective object in order to get the sensor to
>> work. A white sheet of paper should work fine. There does appear
>>
> to
>
>> be some ripple in the output waveform. A small capacitor from the
>> signal line to ground should clean this up. I would recommend
>> something on the order of ~0.01uF. Use a ceramic cap, not
>> electrolytic. If you would like the schematic/picture of what I
>> used, let me know and I will get one to you. Again, I was using
>>
> the
>
>> 15, not the 12 but the pinouts are the same.
>> -Bill
>> --- In o...@yahoogroups.com, "Mike Martin" wrote:
>>
>>> Hello All (newbie question)
>>> I'd like to ask two things.
>>> 1)Is the diagram on http://www.oopic.com/gp2d12.htm wrong? The
>>> datasheet in the sensors & detectors folder in the files section
>>>
>> have
>>
>>> the pinout different to that on the oopic site (as well as the
>>>
>> wiring
>>
>>> colours). If I look at mine face-on, from left to right the
>>>
> wiring
>
>> is
>>
>>> yellow/black/red for Vo/GND/Voc but the website suggests
>>>
>> GND/Voc/Vc.
>>
>>> So you see, I'm having trouble figuring out if it even works.
>>> 2)Also, does someone have a code snippet (or a known working
>>>
>> diagram)
>>
>>> I could borrow to test it? I'm not entirely sure what to read
>>>
> from
>
>>> the IO line. What does IR.Value produce? So far all I can get out
>>>
>> of
>>
>>> it is an integer value of 46. I'm using B.1.0 firmware. How can a
>>> digital IOline read fluctuating voltages? Is it converted to
>>>
>> varying
>>
>>> pulses? The code I'm using is below:
>>>
>>> 'Turns on a RED LED - fishing for a value out of the IR
>>> Sub main()
>>> Red.IOLine = 1
>>> IR.IOLine = 3
>>> Red.Value = 0
>>> ooPIC.ExtVRef=0
>>> IR.Operate=cvTrue
>>> X = IR.Value
>>> If X = 46 Then 'discovered this value by trial and error
>>> Red.TurnOn
>>> End If
>>> Delay = 1000
>>> Red.TurnOff
>>> End Sub
>>>
>>>
>
> ------------------------------------



(You need to be a member of oopic -- send a blank email to oopic-subscribe@yahoogroups.com )

Re: Re: Sharp GP2D12 - ooPIC Tech Support - Apr 14 14:22:26 2008

Mike,

Virtual Circuit is the OOPIC term for linking objects together to do
processing that happens far faster than scripts run.

DLC

Mike Martin wrote:
> Hi Richard and thanks.I'm using real circuits and components on a
> prototyping board (ie not virtual circuits). Would it be easier just to
> use virtual circuits? I take it that because the sensor outputs a
> varying voltage it's an analog output?
>
>
>> If you assign analog signals to IOLines 1..4 then all of them set to
>> analog.
>>
>
> If I put a (real) wire from IOLine 1 onto the Vo line of the sensor and
> the assign it
>
> Dim IR as New oA2D
> IR.IOLine = 1
>
> then can I do something with IR.Value? Say switch on an LED at some
> threshold? I did what Bill suggested and put it on a multimeter and
> measured Vo with respect to GND and got varying values, so I know the
> sensor works.
>
> Mike M.
> ------------------------------------



(You need to be a member of oopic -- send a blank email to oopic-subscribe@yahoogroups.com )

Re: Sharp GP2D12 - tinslwc - Apr 14 15:29:02 2008

As someone previously stated, use the datasheet to get from volts to
distance. There is a graph that will give you the representation.
If you don't want to do that, get a ruler, object and you meter and
start plotting voltage values for different distances. It is not
going to be linear (or at least doesnt appear to be by the
datasheet). Once you have these values, you can convert volts to the
A2D conversion value by the following formula:
For oA2D:
A2D.Value = 255 * Vo / Vref
For oA2D10:
A2D10.Value = 1023 * Vo / Vref
Vo = Output voltage from sensor
Vref = reference voltage (maximum)

The reference voltage will be 5V unless you are connecting a
different voltage (through a divider or something) to Line 4 and
setting OOPic.ExtVRef = cvTrue. If you are to use an external
reference voltage, I believe that it has to be at least 2.5V and not
more than 5V. (Actually, never connect more than 5V to any Pin on
the pic)

Now, your program can take a value from the A2D and calculate the
distance based on that.
-Bill

--- In o...@yahoogroups.com, "Mike Martin" wrote:
>
> Woo Hoo! I've got volts that go up and down! (Thanks Bill). So how
do
> I calibrate it and translate volts into something meaningful though
> the OOPic?
>
> --- In o...@yahoogroups.com, "tinslwc" wrote:
> >
> > Mike,
> > I have used a GP2D15 (a digital output for specific distance) but
> the
> > datasheet that I have has the 12 and 15. Looking on the top of
> the
> > sensor, pins facing toward you, sensor facing away from you, the
> pins
> > are Vo, Gnd, Vcc. If you have a multimeter, you can connect +5
to
> > Vcc, Ground to Ground and read the output (Vo) with you meter
with
> > respect to ground. You should see approximatly 2.5V with an
object
> > about 10 cm away from the sensor and as you move the object away,
> the
> > voltage shoud decay. According to my data sheet (and IR
knowledge)
> > you need to have a reflective object in order to get the sensor
to
> > work. A white sheet of paper should work fine. There does
appear
> to
> > be some ripple in the output waveform. A small capacitor from
the
> > signal line to ground should clean this up. I would recommend
> > something on the order of ~0.01uF. Use a ceramic cap, not
> > electrolytic. If you would like the schematic/picture of what I
> > used, let me know and I will get one to you. Again, I was using
> the
> > 15, not the 12 but the pinouts are the same.
> > -Bill
> > --- In o...@yahoogroups.com, "Mike Martin" wrote:
> > >
> > > Hello All (newbie question)
> > > I'd like to ask two things.
> > > 1)Is the diagram on http://www.oopic.com/gp2d12.htm wrong? The
> > > datasheet in the sensors & detectors folder in the files
section
> > have
> > > the pinout different to that on the oopic site (as well as the
> > wiring
> > > colours). If I look at mine face-on, from left to right the
> wiring
> > is
> > > yellow/black/red for Vo/GND/Voc but the website suggests
> > GND/Voc/Vc.
> > > So you see, I'm having trouble figuring out if it even works.
> > > 2)Also, does someone have a code snippet (or a known working
> > diagram)
> > > I could borrow to test it? I'm not entirely sure what to read
> from
> > > the IO line. What does IR.Value produce? So far all I can get
out
> > of
> > > it is an integer value of 46. I'm using B.1.0 firmware. How can
a
> > > digital IOline read fluctuating voltages? Is it converted to
> > varying
> > > pulses? The code I'm using is below:
> > >
> > > 'Turns on a RED LED - fishing for a value out of the IR
> > > Sub main()
> > > Red.IOLine = 1
> > > IR.IOLine = 3
> > > Red.Value = 0
> > > ooPIC.ExtVRef=0
> > > IR.Operate=cvTrue
> > > X = IR.Value
> > > If X = 46 Then 'discovered this value by trial and error
> > > Red.TurnOn
> > > End If
> > > Delay = 1000
> > > Red.TurnOff
> > > End Sub
> > >
>
------------------------------------



(You need to be a member of oopic -- send a blank email to oopic-subscribe@yahoogroups.com )

RE: Re: Sharp GP2D12 - Mike Martin - Apr 20 10:13:53 2008

Now that's a good thought. "Meaningful to whom (or what)?" Interesting how
different people think, don't you think? I can see that now. It's a very
abstract idea - a new way of thinking for me perhaps.

PS. Hmm, inches fathoms or furlongs - millimetres, metres or
kilometres..heh, heh (Down Under is metric) :-)

Mike M.

_____

From: o...@yahoogroups.com [mailto:o...@yahoogroups.com] On Behalf Of
ooPIC Tech Support
Sent: Tuesday, 15 April 2008 4:19 AM
To: o...@yahoogroups.com
Subject: Re: [oopic] Re: Sharp GP2D12

Mike Martin wrote:
> Woo Hoo! I've got volts that go up and down! (Thanks Bill). So how do
> I calibrate it and translate volts into something meaningful though
> the OOPic?
Meaningful to whom? :) Look at the Sharp data sheet to get the
values and what their range represents. I myself don't translate them
at all. I find the value for the range that I'm interested in and let
the robot deal with it that way - A robot doesn't care if its inches,
fathoms or furlongs.

DLC
> --- In oopic@yahoogroups. com, "tinslwc"
wrote:
>
>> Mike,
>> I have used a GP2D15 (a digital output for specific distance) but
>>
> the
>
>> datasheet that I have has the 12 and 15. Looking on the top of
>>
> the
>
>> sensor, pins facing toward you, sensor facing away from you, the
>>
> pins
>
>> are Vo, Gnd, Vcc. If you have a multimeter, you can connect +5 to
>> Vcc, Ground to Ground and read the output (Vo) with you meter with
>> respect to ground. You should see approximatly 2.5V with an object
>> about 10 cm away from the sensor and as you move the object away,
>>
> the
>
>> voltage shoud decay. According to my data sheet (and IR knowledge)
>> you need to have a reflective object in order to get the sensor to
>> work. A white sheet of paper should work fine. There does appear
>>
> to
>
>> be some ripple in the output waveform. A small capacitor from the
>> signal line to ground should clean this up. I would recommend
>> something on the order of ~0.01uF. Use a ceramic cap, not
>> electrolytic. If you would like the schematic/picture of what I
>> used, let me know and I will get one to you. Again, I was using
>>
> the
>
>> 15, not the 12 but the pinouts are the same.
>> -Bill
>> --- In oopic@yahoogroups. com, "Mike
Martin" wrote:
>>
>>> Hello All (newbie question)
>>> I'd like to ask two things.
>>> 1)Is the diagram on http://www.oopic.
com/gp2d12.htm wrong? The
>>> datasheet in the sensors & detectors folder in the files section
>>>
>> have
>>
>>> the pinout different to that on the oopic site (as well as the
>>>
>> wiring
>>
>>> colours). If I look at mine face-on, from left to right the
>>>
> wiring
>
>> is
>>
>>> yellow/black/red for Vo/GND/Voc but the website suggests
>>>
>> GND/Voc/Vc.
>>
>>> So you see, I'm having trouble figuring out if it even works.
>>> 2)Also, does someone have a code snippet (or a known working
>>>
>> diagram)
>>
>>> I could borrow to test it? I'm not entirely sure what to read
>>>
> from
>
>>> the IO line. What does IR.Value produce? So far all I can get out
>>>
>> of
>>
>>> it is an integer value of 46. I'm using B.1.0 firmware. How can a
>>> digital IOline read fluctuating voltages? Is it converted to
>>>
>> varying
>>
>>> pulses? The code I'm using is below:
>>>
>>> 'Turns on a RED LED - fishing for a value out of the IR
>>> Sub main()
>>> Red.IOLine = 1
>>> IR.IOLine = 3
>>> Red.Value = 0
>>> ooPIC.ExtVRef=0
>>> IR.Operate=cvTrue
>>> X = IR.Value
>>> If X = 46 Then 'discovered this value by trial and error
>>> Red.TurnOn
>>> End If
>>> Delay = 1000
>>> Red.TurnOff
>>> End Sub
>>>
>>> ------------------------------------



(You need to be a member of oopic -- send a blank email to oopic-subscribe@yahoogroups.com )