Diferencia entre revisiones de «Mini horno»

Página creada con « * * AREF Analog pin 0 * | | * 3.3V |-+---/\/\/\-----+-----/\/\/\-----| GND * * ^ ^ * 10K thermistor 10K resistor: #include <SmoothThermistor.h> float t_objectivo = 15; SmoothThermistor smoothThermistor(A0, // the analog pin to read from ADC_SIZE_10_BIT, // the ADC size 10000, /…»
 
Sin resumen de edición
 
(No se muestra una edición intermedia del mismo usuario)
Línea 1: Línea 1:
<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(12, OUTPUT);
   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(12, calentar);
   digitalWrite(CALENTADOR, calentar);
   digitalWrite(13, calentar);
   digitalWrite(13, calentar);
   delay(1000);
   delay(1000);
}
}
</pre>