Was planning to use the outputs in an nested if program, instead of putting up all of it the conditions just wondered if i can make them into one variable and compare the value for the conditions
@pjaypabs: Welcome, I don’t think we have run into each other before… but, I’m off in 32-bit land mostly these days.
In C/C++/Arduino the descriptive term is variable type: Boolean, integer, string, float, String … that sort of thing.
When you read a digital pin, your results are either High or Low (Boolean).
When you read an analog pin, your results are an unsigned integer (However often seen in Arduino code as a int)
While this example was meant to print over the USB via HID, you can at least see how various values can be read and output. You might as well read this article to understand the syntax that I am using to print.
An array element (name) must always have an index… such as myArray which is the third element.
IT IS A VERY UNWISE practice to attempt to compare a float value with an int… very bad. Floats are IEEE compliant structures and what you really need to do is to compare them using < (less than) or > (greater than).