Nee help with a code?
randyleek
Posts: 4
I am new here and a beginer. I'm trying to write a code that Random choses a output between two pins for 2 seconds, then returns back Low.·I think i have part figured out, just not the random part.
·Thanks for any help
············ motor:· ·' my Sub
·············· Random· ?????????????·· 'I want pin 6 or 7 to high for 2 seconds and return low
························ Pause 2000
·························· low 6
·························· low 7
···················· Return
·Thanks for any help
············ motor:· ·' my Sub
·············· Random· ?????????????·· 'I want pin 6 or 7 to high for 2 seconds and return low
························ Pause 2000
·························· low 6
·························· low 7
···················· Return
Comments
then just assign a pin to go low if the number matches the result.
Post Edited (kf4ixm) : 1/14/2010 4:14:22 PM GMT
i have pins 6 & 7 at LOW.
i want to make a call (gosub motor) and have the call RANDOM chose pin 6 or 7 and go HIGH 5v output for 2 seconds and return back LOW, and return from my call.
Post Edited (kf4ixm) : 1/15/2010 12:06:33 AM GMT
···· motor:· ·' my Sub
·············· Random··· 'I want pin 6 or 7 to high for 2 seconds and return low
··················
···························High 6
···························High 7
······························· pause 2000
································ LOW 6
································ LOW 7
···················· Return
this should get you close.
Post Edited (kf4ixm) : 1/15/2010 1:41:18 AM GMT
I'm new to the basic stamp and pbasic. I love tinkering with electronics and am planning to get more serious. i've taking C++ for a while and enjoyed it.
Again THANKS