This Forum is Dedicated For all The Object Oriented PIC Lovers .......... The concept behind OOPic is straight forward. Use preprogrammed multitasking Objects from a library of highly optimized Objects to do all the work of interacting with the hardware. Then write small scripts in Basic, C, or Java syntax styles to control the Objects. During operation, the Objects run continuously and simultaneously in the background while the scripts run in the foreground telling the objects what to do.

Monday, April 14, 2008

[oopic] Re: Sharp GP2D12

--- In oopic@yahoogroups.com, "Mike Martin" <xaviour2me@...> 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

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

Yahoo! Groups Links

<*> To visit your group on the web, go to:

http://groups.yahoo.com/group/oopic/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:

http://groups.yahoo.com/group/oopic/join

(Yahoo! ID required)

<*> To change settings via email:
mailto:oopic-digest@yahoogroups.com
mailto:oopic-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
oopic-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:

http://docs.yahoo.com/info/terms/

No comments: