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.

Saturday, February 2, 2008

Re: [oopic] Function of OOpic still unclear...help!

Here is a very basic example of oopic code. It exemplifies how the oopic
can be used.

This code is very simple all it does is allow the user to push a button,
triggering an event which then tells the servo what new position it should
be in. To do this I use four objects oServo, oDIO1, oWire, and OEvent.
Each object has a set of variables, which the programmer can set. Go to the
OOPic library for a list of each object's variables. Notice how the
object's functions are interwoven. Essentially objects can be inserted into
other objects as variables for instance button1 is linked to the oEvent by
the oWire hence oWire's variables are input: oDio1 and output oEvent.
Going further the oEvent is basically a piece of procedural programing,
which in this case tells the servo what position it should be in.


Dim servo1 As New oServo
Dim button1 As New
oDIO1 "Notice each
object is identified,
Dim wire1 As New oWire
Dim positionchange1 As New oEvent

Sub Main()
ooPIC.Delay = 500

servo1.IOLine =
31 I asign
hardware lines, and variables for each
servo1.Center =
21 object
servo1.Operate = cvTrue
servo1.Position = 21

button1.IOLine = 7
button1.Direction = cvInput

wire1.Input.Link(button1)
linking the button to the oEvent
wire1.Output1.Link(positionchange1.Operate)

wire1.InvertIn = cvTrue
wire1.Operate = cvTrue

End Sub

Sub positionchange1_Code() oEvent
procedural code

servo1.Position = 63

End Sub


On Feb 1, 2008 1:15 AM, bronwyn_3120 <Bronwyn3120@aol.com> wrote:

> I went to the website www.oopic.com to have a better understanding of
> what it does. Is there anyone who could explain what they were saying
> in laymans term (see bottom paragraph)? This is my first time using
> the Oopic microcontroller. I would really appreciate any kind of help
> anyone is willing to give. Thank you =]
>
> OOPic is an acronym for Object-Oriented PIC
> The first PICmicro operating system to use an Object-Oriented
> approach to hardware control.
>
> 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. Every aspect of the Objects can be controlled by
> the scripts as the Object do their work with the hardware. The OOPic
> Object library contains Object that know how to interact with the
> most popular sensors and drive systems around which make the OOPic
> ideally suited for robotics of any kind.
>
>
>


[Non-text portions of this message have been removed]


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: