PImage fondo;
int temperatura = 0;
int humedad = 0;
int iluminacion = 0;
void setup() {
size(400, 400);
fondo = loadImage("higrometro.jpg");
}
void draw() {
background(255);
image(fondo, 0, 0);
drawTemp(temperatura);
drawHumedad(humedad);
drawIluminacion(iluminacion);
}
void drawTemp(float temp)
{
}
void drawHumedad(float hum)
{
int cx = 200, cy = 206, radio = 150;
// la humedad va de 0% a 100%
float angulo = map(hum, 0, 100, -240, 60) * (PI/180);
stroke(255);
strokeWeight(4);
line(cx, cy, cx + cos(angulo) * radio, cy + sin(angulo) * radio);
}
void drawIluminacion(float ilum)
{
}