Diferencia entre revisiones de «Mini horno»
Sin resumen de edición |
Sin resumen de edición |
||
| Línea 1: | Línea 1: | ||
<pre> | <pre> | ||
/* | /* | ||
* | * | ||
| Línea 9: | Línea 10: | ||
* 10K thermistor 10K resistor | * 10K thermistor 10K resistor | ||
*/ | */ | ||
#include <SmoothThermistor.h> | #include <SmoothThermistor.h> | ||
float t_objectivo = 15; | float t_objectivo = 15; | ||
const int CALENTADOR = 12; | |||
SmoothThermistor smoothThermistor(A0, // the analog pin to read from | SmoothThermistor smoothThermistor(A0, // the analog pin to read from | ||
| Línea 24: | Línea 28: | ||
Serial.begin(9600); | Serial.begin(9600); | ||
smoothThermistor.useAREF(true); | smoothThermistor.useAREF(true); | ||
pinMode( | pinMode(CALENTADOR, OUTPUT); | ||
pinMode(13, OUTPUT); | pinMode(13, OUTPUT); | ||
} | } | ||
| Línea 30: | Línea 34: | ||
void loop() { | void loop() { | ||
float t_actual = smoothThermistor.temperature(); | float t_actual = smoothThermistor.temperature(); | ||
Serial.print("min:"); | |||
Serial.print("t_objectivo:"); | Serial.print(13); | ||
Serial.print(" max:"); | |||
Serial.print(23); | |||
Serial.print(" t_objectivo:"); | |||
Serial.print(t_objectivo); | Serial.print(t_objectivo); | ||
Serial.print(" "); | //Serial.print(" "); | ||
Serial.print("t_actual:"); | Serial.print(" t_actual:"); | ||
Serial.println(t_actual); | Serial.println(t_actual); | ||
| Línea 49: | Línea 56: | ||
} | } | ||
digitalWrite( | digitalWrite(CALENTADOR, calentar); | ||
digitalWrite(13, calentar); | digitalWrite(13, calentar); | ||
delay(1000); | delay(1000); | ||
} | } | ||
</pre> | </pre> | ||