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, January 14, 2008

Re: [oopic] events again

Thanks for your help so far. I really do appreciate the effort. I took a
picture a corner of my bread board. I labeled all of the wires in the picture.
1. I comment out the events and use just the do loop and if statements. When
I remove the 5 volt internal power, this would be the same as hitting the
bumper switch, it works fine. it goes to the subroutine and the yellow led
blinks 10 times. If I put the power back on it finishes the 10 count blinking
and rests.
2. I comment out the if statement, leave the empty do loop and put the event
information back in. When I remove the 5 volt external power the red led
blinks. It does not do the count at all. No other leds come on. You mentioned,
in your last note, you thought it was rebooting the OOpic. I have to say that
is what it looks like but wouldn't it make more sense if it were resetting
when I have 5 volts applied not when I have it connected to ground?

I tried several values of resistor just to make sure. I have included my
code again just in case. Any guesses?


Dim ev1 As New oEvent
Dim led7 As New oLED
Dim led6 As New oLED
Dim led5 As New oLED
Dim sw1 As New oSwitch
Dim wi1 As New oWire

Sub main()
led7.IOLine = 7 'red
led6.IOLine = 6 'yellow
led5.IOLine = 5 'green
sw1.IOLine = 15 'read the switch on line 15
ooPIC.Delay =500
led7.TurnOn 'some indication it is on

wi1.Input.Link(sw1.Position) 'read the switch normally 1
wi1.InvertOut = cvTrue 'yes invert the output
wi1.Output.Link(ev1.Operate) 'inverted output to event norm 0
wi1.Operate = cvTrue 'turn the wire on
Do
'If sw1.IsOff 'if switch is at zero volts logic 0
' led5.TurnOnBright
' led6.TurnOff
' ev1_Code
'Else 'if switch is at 5 volts logic 1
' led6.TurnOn
' led5.TurnOff
'EndIf
Loop
End Sub

Sub ev1_Code()
Do 10 Times
led6.TurnOn
ooPIC.Delay = 1000
led6.TurnOff
ooPIC.Delay = 1000
Loop
End Sub

**************Start the year off right. Easy ways to stay in shape.

http://body.aol.com/fitness/winter-exercise?NCID=aolcmp00300000002489


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