So I was trying to figure out a decent way to speed up the time it took to reset I ended up taking another instance of the low being +2
and then adding the first high-low-low as being 2.25 degrees I have added a few video's so you can see the results I am by far no means
any good when it comes to messing with the arduino besides using other people code but since I got that kit let me tell you its be a great
adventure in the arduino land.
//LOVE METER WITH FASTER RESET.
const int sensorPin = A0;const float baselineTemp = 22.0;
void setup(){ Serial.begin(9600);
for(int pinNumber = 2; pinNumber<5; pinNumber++){
pinMode(pinNumber,OUTPUT);
digitalWrite(pinNumber, LOW);
}
}
void loop(){
int sensorVal = analogRead(sensorPin);
Serial.print("Sensor Value: ");
Serial.print(sensorVal);
float voltage = (sensorVal/1024.0) * 5.0;
Serial.print(", Volts: ");
Serial.print(voltage);
Serial.print(", degrees C: ");
float temperature = (voltage - .5) * 100;
Serial.println(temperature);
if(temperature < baselineTemp){
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
}
else if(temperature >= baselineTemp+2.25 && temperature < baselineTemp+4){
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(4, LOW); }
else if(temperature >= baselineTemp+4 && temperature < baselineTemp+6){
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, LOW); }
else if(temperature >= baselineTemp+6){
digitalWrite(2, HIGH);
digitalWrite(3, HIGH); digitalWrite(4, HIGH);
}
else if(temperature >= baselineTemp+2){
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
}
delay(.25);
}
This code seemed to output the following for me which I didn't think to be ideal the above code tho
Produced the below video here which I felt was better. (was a bit cooler in the room when I did this bottom one
so test didn't light up all 3 but will give you a example of the drop at the end)
PLEASE POST BELOW IF THERE IS A BETTER CODE TO TRY.
Will play with this more but more info is always appreciated.
Top Comments