> 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.
Without the event trigger you will never hit the event subroutine, so
this makes no sense. If you have the if/then statements in one LED
should be on and the other off, opposite when the button is pressed.
The green and yellow LEDs should be alternating depending upon the state
of the switch. So I'm not sure what is going on.
> 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?
How many times? This still sounds like a reset to me.
> I tried several values of resistor just to make sure. I have included my
> code again just in case. Any guesses?
Graphics can't be posted in the group so you'll have to make your
image somewhere and post a link. A schematic showing the pin numbers
you used on the board would be best.
Two of us have tried your code and the event code works fine. The
only thing left is that your wiring is incorrect or your board is bad.
Try a simple program with a real button switch that blinks an LED and
work up from there. Make sure that your button is normally logic high,
pulled up with a resistor and that your button pulls this IOLine to ground.
DLC
DLC
>
> 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
>
>
>
>
>
--
------------------------------------------------------
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