RCTIME and PAUSE duration (giving "pause duration" a broader range)
TonyA
Posts: 226
Hi,
I am using this to adjust pause duration:
HIGH 14
PAUSE 1
RCTIME 14, 1, pause_result
rhythm = pause_result / 6
PAUSE rhythm
I'm using the above to read a 10 kOhm pot with a 0.1 cap. I get a range from 1-652.
I am wondering if it is possible to get a broader range, like from -10 to 1000.
My goal is to make the "rhythm" have a range that is much slower and much faster than what I am currently getting.
Thanks for any help,
Tony
I am using this to adjust pause duration:
HIGH 14
PAUSE 1
RCTIME 14, 1, pause_result
rhythm = pause_result / 6
PAUSE rhythm
I'm using the above to read a 10 kOhm pot with a 0.1 cap. I get a range from 1-652.
I am wondering if it is possible to get a broader range, like from -10 to 1000.
My goal is to make the "rhythm" have a range that is much slower and much faster than what I am currently getting.
Thanks for any help,
Tony
Comments
As for getting a bigger value out of RCTIME, I believe you can add a bigger resistor for the cap to discharge through, which will take more time.· Or perhaps even a bigger cap would work, to a point.· Keep in mind that RCTIME has some upper limit... I don't recall what it is.· Probably a WORD's worth.
· rhythm = pauseResult */ 389 + 9
Note the + 9 is required to meet your bottom end requirement (1 x 1.5 will be 1.5 and get truncated to 1, so adding 9 gets you to 10).
If verified the equation with a simple test loop:
· FOR result = 1 TO 652
··· rhythm = result */ 389 + 9
··· DEBUG DEC result, TAB, DEC rhythm, CR
· NEXT
And found that the output was 10 (when result is 1) to 999 (when result is 652).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
I was able to slow it down to a good value, speeding it up is now what I need.
Thanks for your help,
Tony
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
HIGH 14
PAUSE 1
RCTIME 14, 1, pause_result
rhythm = pause_result */ 389 + 9
PAUSE rhythm
But I don't get any change in the ryhthm. I even tried varying the numbers, no change.
I have been able to slow it down by doing this:
HIGH 14
PAUSE 1
RCTIME 14, 1, pause_result
rhythm = pause_result
PAUSE rhythm * 6
DEBUG "pause time = ", DEC5 pause_result, " ", CR
This produces a nice slow beat. Now I need to retain this slow pause duration (slow beat when "pause duration = 652), while getting it to go faster on the other end (when pause time = 1)
(I apologize if I don't know what I'm saying, but I do actually learn this way, and it's a lot of fun)
Learning = more Stamps = higher Parallax profits = possible salary raise... <---joking
Thanks again,
Tony
Post Edited (TonyA) : 8/8/2005 4:55:34 PM GMT
HIGH 14
PAUSE 1
RCTIME 14, 1, pause_result
rhythm = pause_result
PAUSE rhythm * 4
DEBUG "pause time = ", DEC5 pause_result, " ", CR
For some reason PAUSE rhythm * 4 worked better in getting a slower PAUSE duration than rhythm = pause_result */ 389 + 9
· result = 652 - result
· IF (result.BIT15 = 1) THEN result = 0
The second line is required in case the result exceeds what you expect (this can happen with component variations).· That line checks BIT15 of result which will be 1 if the value is negative; when that happens IF-THEN corrects it to zero.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
HIGH 14
PAUSE 1
RCTIME 14, 1, pause_result
rhythm = pause_result
PAUSE rhythm * 4
DEBUG "pause time = ", DEC5 pause_result, " ", CR
Do you think there is some other math that would speed up the PAUSE duration? Or maybe the use of a smaller value pot (like 5 k Ohms). I did try a smaller value cap, no change.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Would it be possible to use 2 instances of the RCTIME and Pause duration (using two pots) to modify the pause duration.
(Like two beats ocurring at the same time.) Or will the BS2 only execute one instance?
' Instance 1
HIGH 14
PAUSE 1
RCTIME 14, 1, pause_result
rhythm = pause_result
PAUSE rhythm * 4
' Instance 2
HIGH 13
PAUSE 1
RCTIME 13, 1, pause_result2
rhythm2 = pause_result2
PAUSE rhythm2 * 4
(I'm just experimenting out loud, sorry)
Tony
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Is there anything else you can do with rctime and Pause to make things more interesting in this way? (Any referrences to literarure or anything online would be appreciated). Thanks again.
Tony