dennis.clark@oopic.com writes:
Again thanks for your effort I know this isn't easy
> 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.
I am sorry if I wasn't clear on that point. If you look at my code you will
see that I included the event sub in my if statement code just to make sure
it is working and it does. Of course when I comment out my if statement I
comment out the call to the code also.
> 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.
It blinks continuously If it is resetting then it is resetting at the rate
of 50 to 100 times a minute. It can't be running the program because I have a
wait of 500 at the beginning of the program.
> 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.
You can see my wiring here
_http://www.daviddavis.org/robotwiring/robotpage.htm_
(http://www.daviddavis.org/robotwiring/robotpage.htm)
Two of us have tried your code and the event code works fine.
Did you try it on a C board or as you described on and R board?
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.
I will try to simplify the program more but that is what I was attempting to
do with this program
Make sure that your button is normally logic high,
pulled up with a resistor and that your button pulls this IOLine to ground.
I am not trying to be a smart butt when I ask this question I really don't
know.
Except for the fact that I am pulling the 5 volt wire from the board instead
of pushing a button isn't what I have exactly what you are describing?
Correct me if I am wrong, because againg I don't know but I thought that If
my wiring is correct for my if statements then my wiring has to be correct
for the event?
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( wi1.Input.Link(<WBR>sw1.Position) 'read t
> wi1.InvertOut = cvTrue 'yes invert the output
> wi1.Output.Link( wi1.Output.Link(<WBR>ev1.Operate) 'inverted outpu
> 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
>
>
>
>
>
> ************ ************<WBR>**Start the year off right. Easy ways
> _http://body.http://body.
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
--
------------------------------------------------------
Dennis Clark ooPIC Tech Support
www.oopic.com
------------------------------------------------------
**************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:
No comments:
Post a Comment