Animation

Using variables

When you create a variable, you have to state the variable’s type. After that you can change the variables value by assigning a new value to the variable.

Create new variable: float f = 3.14;. Assign a new value: f = 6.28;

If you create a variable in the beginning of the sketch, it will be visible for the whole sketch. If you create a variable inside a function (like setup or draw) it will only be visible in the corresponding function.