Created
November 21, 2020 14:45
-
-
Save azaharafernandezguizan/db62b57ce7cceabe69f68f89d04752d3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int airSensorDig = 10; | |
int airSensorAnalog = 3; | |
int ppm_AirSensor = 0; | |
float tension_AirSensor = 0; | |
bool state_AirSensor = false; | |
String resultAirSensorPPM = ""; | |
void setup() | |
{ | |
} | |
void loop() | |
{ | |
AirSensorControl(); | |
delay(500); | |
} | |
void AirSensorControl() | |
{ | |
state_AirSensor = digitalRead(airSensorDig); | |
ppm_AirSensor = analogRead(airSensorAnalog); | |
tension_AirSensor = ppm_AirSensor * (5.0 / 1023.0); | |
resultAirSensorPPM = ""; | |
resultAirSensorPPM.concat(ppm_AirSensor); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment