Hallo,
möchte gerne, wenn sich der PWM Wert verändert, diesen als % ausgeben. Leider kommt immer nur 0 an.
float prozent[5];
.
.
.
default:
analogWrite(stripePin[loop], i[loop]);
prozent[loop] == i[loop]/256*100;
.
.
.
if (millis() - timemillis > 1000) {
timemillis = millis();
getDateDs1307(&second, &minute, &hour, &dayOfWeek, &dayOfMonth, &month, &year);
Serial.print(hour, DEC);
Serial.print(":");
Serial.print(minute, DEC);
Serial.print(":");
Serial.print(second, DEC);
Serial.print(" ");
Serial.print(dayOfMonth, DEC);
Serial.print(".");
Serial.print(month, DEC);
Serial.print(".");
Serial.print(year, DEC);
Serial.print(" Tag:");
Serial.print(dayOfWeek, DEC);
Serial.print(" LED1: ");
Serial.print(prozent[0], 0);
Serial.print(" % |");
Serial.print(" LED2: ");
Serial.print(prozent[1], 0);
Serial.print(" % |");
Serial.print(" LED3: ");
Serial.print(prozent[2], 0);
Serial.print(" % |");
Serial.print(" LED4: ");
Serial.print(prozent[3], 0);
Serial.println(" %");
}
LIegt der Fehler in der Varable? Aber habe mehreres durchprobiert. Bleibt bei 0:(
Hoffe ihr könnt helfen..:Danke