Search the web
Sign In
New User? Sign Up
selmaware · StampPlot by SelmaWare Solutions
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Looping through a program.   Message List  
Reply | Forward Message #192 of 601 |
I am a newbie so forgive. I am trying to loop through a stamp set of
instructions several times (to get triplicate readings) I am using
the FOR-NEXT code but am unable to program anything that makes sense.

Any hints would be appreciated.

Thanks Mike Z




'{$STAMP BS2}
'-----Define variables, set status of pins -----
reps VAR WORD
x VAR WORD
y VAR WORD
z VAR WORD
cnt VAR WORD
cmt VAR WORD
clt VAR WORD
S0 CON 0
S1 CON 1
S2 CON 2
S3 CON 3
LED1 CON 11
LED2 CON 12
LOW S0 'Sets status of TSL230 pins
HIGH S1
HIGH S2
LOW S3
LOW 4 'Toggle state to enable/disable chip – change this if there is
no
'output from the TSL230
'-----Main program loop-----`


ROUTINE1
LOW LED1
PAUSE 2000
FOR x = 1 TO 2000
COUNT 5, 1, cnt 'Count on pin 5 for 1 ms, store value in cnt
DEBUG DEC cnt, CR 'Send value of cnt, as a decimal to the computer
NEXT 'Do it all over again, 2000 times
IF x=2000 THEN ROUTINE2

ROUTINE2:
PAUSE 2000
FOR y = 1 TO 2000
COUNT 6, 1, cmt 'Count on pin 6 for 1 ms, store value in cmt
DEBUG DEC cmt, CR 'Send value of cmt, as a decimal to the computer
NEXT 'Do it all over again, 2000 times
IF y=2000 THEN ROUTINE3


ROUTINE3:
HIGH LED1
LOW LED2
PAUSE 2000
FOR z = 1 TO 2000
COUNT 7, 1, clt 'Count on pin 6 for 1 ms, store value in clt
DEBUG DEC clt, CR 'Send value of clt, as a decimal to the computer
NEXT 'Do it all over again, 2000 times
HIGH LED2
IF z = 2000 THEN ROUTINE4


ROUTINE4
FOR reps = 1 TO 3
GOTO ROUTINE1
NEXT
END










Tue Jul 8, 2003 3:08 am

mziegler1485
Offline Offline
Send Email Send Email

Forward
Message #192 of 601 |
Expand Messages Author Sort by Date

I am a newbie so forgive. I am trying to loop through a stamp set of instructions several times (to get triplicate readings) I am using the FOR-NEXT code but...
mziegler1485
Offline Send Email
Jul 8, 2003
3:08 am

I am not an expert either, but see if this will work for you. Mike '{$STAMP BS2} '-----Define variables, set status of pins ----- reps VAR WORD x VAR WORD y...
Mike Smith
okieflyer2000
Offline Send Email
Jul 8, 2003
1:23 pm

Mike Thank you---Worked perfectly! MikeZ...
mziegler1485
Offline Send Email
Jul 9, 2003
1:26 pm

Mike Thank you---Worked perfectly! MikeZ...
mziegler1485
Offline Send Email
Jul 9, 2003
1:28 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help