Computer Science Canada Can you assign a variable as a delay? |
Author: | TipsyCzar [ Thu Nov 03, 2016 7:40 am ] | ||
Post subject: | Can you assign a variable as a delay? | ||
What is it you are trying to achieve? <I'm trying to assign an integer or real variable as a delay value> What is the problem you are having? <"Argument is the wrong type" appears on all delays that use variables (other delays are fine)> Post any relevant code (You may choose to attach the file instead of posting the code if it is too long) <Sample of the code>
Please specify what version of Turing you are using <4.1.1> |
Author: | Insectoid [ Thu Nov 03, 2016 9:30 am ] |
Post subject: | RE:Can you assign a variable as a delay? |
delay() only takes integer values. You are trying to give it real values. If you need precision to fractions of a millisecond, then you will need to convert the real to an int on the fly by calling delay (int (time1)). Otherwise, just change time1 to an int and you'll be fine. |
Author: | lordroba [ Sat Nov 05, 2016 3:38 pm ] | ||
Post subject: | Re: Can you assign a variable as a delay? | ||
You can use the round function
|