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

[oopic] events again

About a month or so ago you tried to help me with event
programming. I eventually gave up and used To Do Loops figuring I was
just too dumb to figure it out.
I have another situation that requires Event programming. I took
the code below from the manual. I changed it so I could see leds in
different parts of the program but I did not change the event part.
I would expect the code below to delay 5 seconds turn on the
green led, go to the event subroutine, turn on the red led wait 1
second and turn it off. From there blink the red led every 1 second.
What happens is there is a delay of 5 seconds the green led comes
on and goes out after a second or so then delays 5 seconds and comes
back on. Like it is rebooting. This time I have nothing connected to
the board.
I tried the virtual circuit in chapter 7. That works as expected.
Could I get you to run this code and see if it works correctly
please? another question that might be related. Pin 21 is supposed to
be 5 volt pwr I get 6.49 volts. Is that correct?

c 1.1 + board v 6.1.1 compiler

Dim BLINK As New oEvent
Dim WIRE As New oWire
Dim led7 As New oLED
Dim led5 As New oLED

Sub Main()
ooPIC.Delay = 5000
led5.IOLine = 5
led5.TurnOn
led7.IOLine = 7
WIRE.Input.Link(ooPIC.Hz1)
WIRE.Output.Link(BLINK.Operate)
WIRE.Operate = cvTrue
End Sub

Sub BLINK_Code()
led7.TurnOn
ooPIC.Delay =1000
led7.TurnOff
End Sub



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: