Bu haftaki çalışmamızda arduinoda gaz sensörü yapmaya çalıştık
void setup() {
// put your setup code here, to run once:
pinMode(8, OUTPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
int a = analogRead(A0);
Serial.println(a);
digitalWrite(8, HIGH);
if (a > 600) {
digitalWrite(8, HIGH);
}
else {
digitalWrite(8, LOW);
}
if (a>400) {
digitalWrite(6,HIGH);
}
else {
digitalWrite(6,LOW);
}
}