Elegoo - Arduino Uno R3 Basic Starter Kit - Lesson 3 - RGB

preview_player
Показать описание
Lets learn how to use the RGB LED on the Uno

Sketch:
Рекомендации по теме
Комментарии
Автор

@AhcMeUk can you please fix the link to scetch it is not works

Garticman
Автор

Hello! Are you able to explain this part to me?

I understand what 'for (int i = 0; i < 255; i += 1)' is doing, but then this is confusing:

redValue -= 1;
greenValue += 1;
// The following was reversed, counting in the wrong directions
// analogWrite(RED, 255 - redValue);
// analogWrite(GREEN, 255 - greenValue);

I understand the redValue = redValue - 1 and greenValue = greenValue +1, but why does it then say both analogWrites are subtracting their color values? or does a negative sign not mean subtraction in this case? I'm starting from scratch with this Elegoo kit, so I was trying to google this for an explanation of what's happening there.

thanks!

hireZach