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.

Sunday, February 3, 2008

Re: [oopic] Re: events again

c 1.1 +, v 6.1.1 compiler, oopic C carrier board (IMG D-9 94v-0 0442)
My whole attempt with that program was to actually see the event program
work. I have not accomplished that yet. I tried changing the delay to 500 as
you suggested, the same results. I tried the program that you sent in your
response and again with no wires attached to my board it still does the same
thing the red led never comes on. the green led blinks on about a 5 second
interval and eventually goes out and stays our, without running the subroutine.
so far the controller has worked as expected except for events. It runs
my robot just fine if I replace the events with To Do loops it works. Is it
possible that the events have quit working on this board/compiler/chip and
every thing else works?

In a message dated 2/3/2008 10:33:37 A.M. Eastern Standard Time,
rstofer@pacbell.net writes:

You need to STOP and find out what is causing the above normal
voltages. Are you talking about some PIN 21 or IOLine 21?
I think my meter was wrong because It was giving me 11.75 on a 9 volt
battery I checked with a borrowed meter, PIN 21 is 5 volts

What
board do you have? Always put that info in your postings. Just the
oopic c carrier board


chip version and compiler version is not sufficient.

You should never see a voltage above 5V on any IOLine.

Change the ooPIC.Delay = 1000 in Sub BLINK_Code() to ooPIC.Delay =
500 and the code will work.

You are calling the event every second and delaying one second in the
event code. Something is likely to get jammed up.

I see that not only doesn't V6 bother to document ooPIC.Delay but
that the units have been changed from 1/100 second to 1/1000 second.
At first I thought you were delaying 50 seconds at startup!

As a practical matter, your code has an issue You are spending more
than 50% of the processor time waiting on a delay. Maybe some
virtual circuits will still be running but mainline code will not.

You can use Hz60 and a counter to get a similar effect:

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

Sub Main()
counter = 0
ooPIC.Delay = 5000
led5.IOLine = 5
led5.TurnOn
led7.IOLine = 7
WIRE.Input.Link(WIRE.Input.
WIRE.Output.WIRE.OutputWIRE.Out
WIRE.Operate = cvTrue
End Sub

Sub BLINK_Code()
counter = counter + 1
If counter = 30 Then
led7.TurnOn
ElseIf counter = 59
counter = 0
led7.TurnOff
End If

End Sub

This has the advantage of no delays but the disadvantage of executing
the event code 60 times per second. I don't seem to get 1 flash per
second, I'll look in to that some day. It's as though Hz60 is really
Hz30!

Richard


**************Biggest Grammy Award surprises of all time on AOL Music.
(http://music.aol.com/grammys/pictures/never-won-a-grammy?NCID=aolcmp003000000025
48)


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