O'Reilly logo

Beginning Arduino Programming by Brian Evans

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

What’s a Variable?

The variables that we use in writing code are the very same variables that we learned about in school. Take the following equation for example:

a2 + b2 = c2

I’m sure you’ve seen this before; it’s the Pythagorean theorem and it’s pretty useful for finding the length of one side of a right-angle triangle if we know any of the other two sides. The letters a, b, and c are the names for numerical data, in this case the letter c is used for the hypotenuse while a and b are the other two sides of the triangle. We can also call these letters variables. Variables are quite simply containers for information. In programming, variables have a name that tells us what data the variable might contain and they have a type that determines ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required