//flex table opened by JP

Click to See Complete Forum and Search --> : Programming a BASIC Stamp...


Fishsauce
08-21-2002, 12:22 AM
I want to program a BASIC Stamp so it will run several LEDs at once. How do you call on the different I/O ports so I can program them. I have a program that currently only lights up one LED but I need something that lights up seven of them. Any Ideas?

Thanks
Fishsauce

Quandary
08-21-2002, 10:54 AM
Show me the code and I might remember how all that IO **** worked on the STAMP... I do rememebr there was a trick to getting at the rest of the ports...

PM the whole baisc file to me, and I'll take a look

-Q

Fishsauce
08-21-2002, 01:22 PM
Output 7
again:
debug cls, "Pin is: ", #pin0
pause 250
pin7 = pin0
goto again

I sent you the PM.

Quandary
08-21-2002, 04:30 PM
All right...

I assume you have the LEDs hooked up to the proper output ports, and that they have the correct polarity...

Try this code instead: (start code)

Output 7
Output 8
Output 9
Output 10
Output 11
Output 12
Output 13
Output 14
Output 15

Out7 = 1
Out8 = 0
Out9 = 1
Out10 = 0
Out11 = 1
Out12 = 0
Out13 = 1
Out14 = 0
Out15 = 1

main_loop:
Toggle 7
Toggle 8
Toggle 9
Toggle 10
Toggle 11
Toggle 12
Toggle 13
Toggle 14
Toggle 15
goto main_loop


(end code)

Don't include my little start/end code things (of course :p) This will start up the ports so that all of the odd lights are on. All of the lights will switch thier on/off status every go through the loop (I think...).

If this doesn't work, I'll try and figure out why.

- Q

-- PS: STAMPs are a pain in the *** to code; I have yet to find a documentation of PBasic. Just get a Motorola microcontroller and learn assembly :D

Fishsauce
08-21-2002, 10:36 PM
Thanks

I had to do alittle modifying because some of the syntax wouldn't work with the stamp. Took awhile but now I got it to do some patterns that look quite cool

Thanks again
Fishsauce