idflyfish Posted August 8, 2011 Share Posted August 8, 2011 (edited) Hello all, I looked for a built in TI function to sleep a program (something akin to Thread.Sleep() in C#) but didn't have any luck finding one. How is this generally done in TI XB? Thanks Edited August 8, 2011 by idflyfish Quote Link to comment Share on other sites More sharing options...
idflyfish Posted August 8, 2011 Author Share Posted August 8, 2011 I guess using an empty loop does the trick. 220 FOR S=1 TO 500::NEXT S 230 RETURN Quote Link to comment Share on other sites More sharing options...
Tursi Posted August 8, 2011 Share Posted August 8, 2011 Pretty much. If you need more accurate(ish) timing and are not using sound, you can use two CALL SOUND statements with volume at 30 (silence). The second one will wait for the first to complete with a 1/60th second accuracy (1/50th second in PAL): CALL SOUND(1000,110,30)::CALL SOUND(1,110,30)::REM Delay 1000ms (1 second) Quote Link to comment Share on other sites More sharing options...
sometimes99er Posted August 8, 2011 Share Posted August 8, 2011 Small note on CALL SOUND. The duration value (1-4250) is not exactly milliseconds on PAL machines. 1 second is approx. 1.2 second on PAL (divide by 50 and multiply by 60). Intern page 166. The duration is converted to a frame count byte (multiply by 6 and divide by 100 with a value of at least 1). 1 Quote Link to comment Share on other sites More sharing options...
jacquesg Posted August 8, 2011 Share Posted August 8, 2011 I guess using an empty loop does the trick. 220 FOR S=1 TO 500::NEXT S 230 RETURN A CALL KEY loop can be written to pause until you press a key. Not sure if this is what you are looking for. Jacques Quote Link to comment Share on other sites More sharing options...
idflyfish Posted August 9, 2011 Author Share Posted August 9, 2011 I guess using an empty loop does the trick. 220 FOR S=1 TO 500::NEXT S 230 RETURN A CALL KEY loop can be written to pause until you press a key. Not sure if this is what you are looking for. Jacques I was just looking for a way to rotate colors on the screen slow enough that my kids can see what is going on. Thanks though. Quote Link to comment Share on other sites More sharing options...
+OLD CS1 Posted August 9, 2011 Share Posted August 9, 2011 I was just looking for a way to rotate colors on the screen slow enough that my kids can see what is going on. Thanks though. Just do it in BASIC, it is slow enough they will be able to see you define characters real-time! Quote Link to comment Share on other sites More sharing options...
idflyfish Posted August 9, 2011 Author Share Posted August 9, 2011 I was just looking for a way to rotate colors on the screen slow enough that my kids can see what is going on. Thanks though. Just do it in BASIC, it is slow enough they will be able to see you define characters real-time! Haha ya. I sat down with them tonight and showed them how to print to the screen and how to change the color of the screen. They thought that was pretty cool. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.