But according to my teacher, this code causes them to fade alternately. Can anyone help me to ensure that they do fade at the same time. One fades out while the other fades in at the same time.
It looks to me like that is exactly what will happen - for each iteration of the for loop, the green LED drive should increase by 1, and the yellow LED drive should decrease by 1.
The relation between the drive numbers 0..255 and the "brightness" as perceived by the human eye may be non-linear...
yes I tried it on arduino and because it's so fast it looks like they fade alternately
but I wonder if that is what my code says, because my teacher claims that my code says that they have to fade in and out while the assignment of the course I'm taking is that one fades out while the other fades in at the same time
yes I tried it on arduino, but my teacher claims that my code tells them to fade in and out in turn, whereas the assignment of the course I'm following is that one fades out while the other fades in at the same time
thank you, but I tried this code before, but then 1 led will stay on while the other slowly fades in and out and then vice versa, but the instruction is for 1 led to slowly turn on while the other slowly fades out at the same time or is that not technically possible?