hi! turn on rgb led strip, depending on temperature normal temperature sensor... our sketch, verificated arduino, does't work concretely, because shows high temperatures (like 100°c). please us??
thanks lot!!!!
thanks lot!!!!
code: [select]
#define red 9// pin red led
#define green 10 // pin green - never explicitly referenced
#define blue 11 // pin blue - never explicitly referenced
#define size 255
#define hue_max 6.0
#define hue_delta 0.01
#define soglia1 32
#define soglia2 25
#define impin 0
void setup ()
{
serial.begin (115200);
pinmode(red, output);
pinmode(green, output);
pinmode(blue, output);
}
float tempc()
{
float raw=analogread(impin);
float percent=raw/1023.0;
float volts=percent*5.0;
return 100.0*(volts-0.5);
}
void loop ()
{serial.print("temperatura=");
serial.print(tempc());
serial.print("\260c;");
serial.println();
if(tempc()>soglia1){
digitalwrite(red,high);
} else {
digitalwrite(red,low);
}
if(tempc()<soglia1>soglia2){
digitalwrite(green,high);
} else {
digitalwrite(green,low);
}
if(tempc()<soglia2){
digitalwrite(blue,high);
} else {
digitalwrite(blue,low);
}
delay(500);
}
firstly, define "normal temperature sensor." there many types.
how ascertaining temperature read?
weedpharma
how ascertaining temperature read?
weedpharma
Arduino Forum > Using Arduino > Programming Questions > Led Strip with temperature
arduino
Comments
Post a Comment