> Hardware wise I have a switch, one side hooked up to 5 volts the
> other side hooked to ground with a 1K resistor.
I would say that the resistor should be on the 5V line to limit the
current, not on the ground line.
> What am I doing wrong?
I am not sure, but your code is working for me with small changes. I
use the OOPic-R board and have a microswitch connected to line 8 with
internal pull-up resistors activated, so I just added this line at the
beginning of main:
ooPIC.PullUp = cvTrue
and changed
sw1.IOLine = 13 to sw1.IOLine = 8
When I press the switch, yellow light blinks 5 times.
Maybe this will be helpful:
http://www.oopic.com/objapp2.htm
--
Mike
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