Hi everyone, I am trying to read an analog value I am calling airState and if both my buttons are pressed I want to set it as a variable to save for later. I have the if statements, the variable, and the buttons figure out, I just cant figure out how to read a variable and assign it a name of its own as a varible.
All guidance will be much appreciated, thanks
psuedo code:
analog read airState
set progairState to current airState reading
[CODE]
airState = analogRead(airPin);
analogRead(airState); //read analog input "airState" and set to memory as "progairState" to compare
Serial.println(progairState); //how do I make progairState equal airState at Serial print time
[CODE]
Answering my own question maybe.... Does this work?
airState = analogRead(airPin);
analogRead(airState); //read analog input and set to memory
if (airState != 0)
Serial.println(progairState);
Message was edited by: Randy Ashdown