PDA

View Full Version : help with multiple outputs...



rickvan
- 25th November 2007, 15:24
I am new to programming with picBasic Pro. I have used the parallax version. Here is the trouble I am having....
I want to sequence 2 outputs, triggered by a push button. In words, this is what i want to happen:
if button is pressed
turn on 1st output
wait half a second
turn on 2nd output (1st output must stay on)
wait half a second
turn 2nd output off
wait 3 seconds
turn 1st output off

my coding goes like this:

main:
if portb.6 = 1 then
goto activate
else
high portc.0
endif
goto main

activate:
high portc.0
pause 500
high portc.1
pause 500
low portc.1
pause 3000
low portc.0
goto main
end

it works fine, except portc.0 shuts itself off when i call portc.1 high. I have tried a variety of simple programs, but can only get one output on at a time.
What am I doing wrong? Basic Stamp editor holds the output high until it is instructed to move it low.

HenrikOlsson
- 25th November 2007, 17:34
Hi rickvan,
Which PIC are you using? My guess is that it has a comparator or something else on the same pins that needs to be turned off.

EDIT: Oh, I see, you've got help in another thread.