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, September 17, 2007

[oopic] Should this code work?

I recently wrote this code to toggle some solid state analog switches, but am unsure if the code is bad or if I am screwing something else up all together. I have a feeling I got some of the hardware wrong, anyone have any suggestions.
Oh secondarily, is there some way to sync output signals or does that happen automatically. Thanks for the help.


Dim switch1 As New oDIO1
Dim switch2 As New oDIO1
Dim switch3 As New oDIO1
Dim switch4 As New oDIO1

Dim button1 As New oDIO1
Dim button2 As New oDIO1

Dim wire1 As New oWire
Dim wire2 As New oWire

Dim routerstate1 As New oEvent
Dim routerstate2 As New oEvent

Sub Main()

ooPIC.Delay = 250

switch1.IOLine = 1
switch1.Direction = cvOutput
switch1.State = cvOn

switch2.IOLine = 2
switch2.Direction = cvOutput
switch2.State = cvOff

switch3.IOLine = 3
switch3.Direction = cvOutput
switch3.State = cvOff

switch4.IOLine = 4
switch4.Direction = cvOutput
switch4.State = cvOff

button1.IOLine = 6
button1.Direction = cvInput

button2.IOLine = 7
button2.Direction = cvInput


wire1.Input.Link(button1)
wire1.Output1.Link(routerstate1.Operate)
wire1.InvertIn = cvTrue
wire1.Operate = cvTrue

wire2.Input.Link(button2)
wire2.Output1.Link(routerstate2.Operate)
wire2.InvertIn = cvTrue
wire2.Operate = cvTrue

End Sub

Sub routerstate1_Code()
switch1.State = cvOn
End Sub

Sub routerstate2_Code()
switch1.State = cvOff

End Sub



---------------------------------
Don't let your dream ride pass you by. Make it a reality with Yahoo! Autos.

[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: