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.

Thursday, July 19, 2007

Re: [oopic] Some help please

wire1.Operate = cvTrue : You have to turn processing objects on.

DLC

carson hoyt wrote:
> So yeah I have no idea why but the button isn't working, is it the code or should I start checking I/O lines for damage? Here is the updated code.
>
> ooPIC.Delay = 500
>
> Dim servo1 As New oServo
> Dim button1 As New oDIO1
> Dim wire1 As New oWire
> Dim positionchange1 As New oEvent
>
> Sub Main()
>
> servo1.IOLine = 31
> servo1.Center = 21
> servo1.Operate = cvTrue
> servo1 = 21
>
> button1.IOLine = 8
> button1.Direction = cvInput
>
> wire1.Input.Link(button1)
> wire1.Output1.Link(positionchange1.Operate)
>
> End Sub
>
> Sub positionchange1_Code()
>
> servo1 = 50
>
> End Sub
>
> Andrew Porrett <slicerwizard@gmail.com> wrote: At 02:27 AM 7/19/2007, carson hoyt wrote:
> >Sub positionchange1_Code
> > > >
> > > > Do
> > > > servo1.Position = 35
> > > >
> > > > Loop
> > > > End Sub
> >
> > >An event handler that loops forever - so does your OOPic just lock up
> > >when it gets here? Why do you want to loop here?
> >Well I want the servo to maintain its position until another button
> >is pressed. I was going to have seperate events for each button.
>
> servo.position = x (or servo = x, IIRC) will move the servo to
> position x and the servo will maintain that position until you tell
> it to move to some other position, so the do loop serves no purpose.
>
> >How would you go about it?
>
> I'd take out the do loop.
>
> > This is the first program I have ever attempted to write so I'm
> > sure it sucks and everything.
>
> Sucks? Naw, you haven't seen some of the doozies that've graced this
> forum. :)
>
> > Am I at least using the right objects?
>
> Looks good to me. Add your other button(s) and event handler(s).
>
> ...Andy
>
>
>
>
>
>
> ---------------------------------
> Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user panel and lay it on us.
>
> [Non-text portions of this message have been removed]
>
>
>
>
> Yahoo! Groups Links
>
>
>

--
------------------------------------------------------
Dennis Clark ooPIC Tech Support
www.oopic.com
------------------------------------------------------

__._,_.___
Recent Activity
Visit Your Group
SPONSORED LINKS
Yahoo! News

Sexual Health

Get important

sex health news

Yahoo! Finance

It's Now Personal

Guides, news,

advice & more.

Biz Resources

Y! Small Business

Articles, tools,

forms, and more.

.

__,_._,___

No comments: