arduino code to fade from one value to a new one

hey everyone!

like the subject says: i need some code for fading from one value to a new one. both values are declared in variables.

please help me!

Interpolate.

sorry my english isn’t so good. (german^^)

this is my code until now.

if (value < oldValue) {
while (value < oldValue) {
for (int i=0; i <= oldValue - value; i++) {
oldValue - 1;
DmxSimple.write(channel, oldValue);
delay(5);
}
DmxSimple.write(channel, oldValue);
}
}
else if (value > oldValue) {
while (value > oldValue) {
for (int i=0; i <= value - oldValue; i++) {
oldValue + 1;
DmxSimple.write(channel, oldValue);
delay(5);
}
DmxSimple.write(channel, oldValue);
}
}

DmxSimple.write(channel, value);
oldValue = value;
oldChannel = channel;

old value + 1; doesn't do anything. You need an assignment or a pre or post increment instead. It looks to me like you've got too many loops.

can't you please :) correct my code and help a "poor" student to finish his project he needs tomorrow XD

i'm relative new to coding and i've also got problems to translate those "technical-jargon-words" into good old german :(

you would really help me out.

thx

Your for loop needs to go from oldValue to newValue. You're over thinking the problem