DLC
jueysmum wrote:
> What I'm trying to do is time an event in seconds, then (eventually)
> write it to an array so that it can be repeated (or modified) at a
> later time. This bit is just to get the time 'measured'.
>
> --- In oopic@yahoogroups.com, ooPIC Tech Support <dennis.clark@...>
> wrote:
>
>>Maybe because the event is called every second and outside of the
>
> event
>
>>it may not be called? Without seeing what you are trying to
>
> explain I
>
>>don't really have a clear idea of the problem.
>>
>>DLC
>>
>>jueysmum wrote:
>>
>>>Hi
>>>In the following code, if I move the if construct outside of the
>>>event handling code, the robot will not stop. If I leave it in
>
> it
>
>>>will. I've done a few further experiments with the code for the
>>>value of counter - some will work outside the event handler,
>
> some
>
>>>won't why is this? Counter is a global variable so why the
>>>difference?
>>>
>>>Dim LeftServo as New oServoX
>>>Dim RightServo as New oServoX
>>>
>>>
>>>Dim CountAdd as New oEvent
>>>Dim Wire as New oWire
>>>Dim RightWire as New oWire
>>>Dim ScreamWire as New oWire
>>>
>>>Dim Scream as New oFreq
>>>
>>>Dim Counter as New oByte
>>>
>>>Sub Main()
>>>
>>> LeftServo.IOLine = 29
>>> RightServo.IOLine = 30
>>> RightServo.InvertOut = cvTrue
>>>
>>> LeftServo.Value = 127
>>> RightServo.Value = 127
>>>
>>> Counter.Value = 0
>>>
>>>
>>>LeftServo.Operate = cvTrue
>>>RightServo.Operate = cvTrue
>>>Wire.Input.Link(OOpic.hz1)
>>>Wire.Output.Link(CountAdd.operate)
>>>Wire.Operate = cvtrue
>>>Scream.Value = 61473
>>> End Sub
>>>
>>>sub CountAdd_CODE()
>>>Counter.inc
>>>Scream.operate = cvtrue
>>>Oopic.delay = 10
>>>Scream.operate = cvfalse
>>>if Counter.value >5 then
>>>RightServo.Operate= cvFalse
>>>LeftServo.Operate = cvFalse
>>>end if
>>>end sub
>>>
>>>Jueysmum
>>>
>>>
>>>
>>>
>>>Yahoo! Groups Links
>>>
>>>
>>>
>>
>>--
>>------------------------------------------------------
>>Dennis Clark ooPIC Tech Support
>>www.oopic.com
>>------------------------------------------------------
>>
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
--
------------------------------------------------------
Dennis Clark ooPIC Tech Support
www.oopic.com
------------------------------------------------------
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:
No comments:
Post a Comment