if (digitalRead(0) == LOW) {//pwm pin = 0
//ortalama alma
total = total - readings[readIndex];
readings[readIndex] = analogRead(A0);
total = total + readings[readIndex];
readIndex = readIndex + 1;
if (readIndex >= numReadings) {
readIndex = 0;
}
average = total / numReadings;
//ortalama alma
//adc to voltaj
adc_v = average * (cpu_v / max_adc);
//adc to voltaj
//voltaj to sıcaklık
c = adc_v * 248 - 7;
//voltaj to sıcaklık
Serial.println(c);
}
if (c > 149) {
analogWrite(0, 0);
}
if (c < 151) {
analogWrite(0, 10000);
}