Floating point number variables (also called floats) are used when you need a number with a decimal point in it.
Declaring a float variable:
Arduino
1
floatmoo;// declaring a float variable named foo
Changing a float variable:
1
moo=21.3;
Declaring and assigning a float variable at the same time:
Arduino
1
floatmoo=0.955;// declaring a float named moo with a value of zero point nine five five
Doing math with a float variable is just like doing regular math with a variable in Algebra.Sometimes float variables create what a rounding error, so use integers whenever you can.
Next Step:
You will often need to work with more than numbers. Sometimes you need to write text. For that, you will need to learn about characters: