![]() – Out is the output signal and LED pin controls the LEDs on the front. – S2/S3 pins control which set of photodiodes we gonna measure (Red/Green/Blue/Clear) – S0/S1 pins control the output frequency scalling The module has (Vcc/GND) pins, they are redundant. The light is detected by the photodiodes and the output is a frequency proportional to the current flowing through the photodiodes which is related to the filter used and the object’s color detected. The module has an 8×8 photodiode array, 16 of them with Red filter, 16 with blue one, 16 with green one and 16 without a filter (clear), we select what filter to use and read its value, and in the code we combine them depending on the applciation or project. ![]() If you feel any difficulty in making it feel free to ask anything in the comment section.Hello, welcome to SurtrTech, in this tutorial we’ll be using the TCS3200, TCS230 or GY-31, color sensor module with Arduino UNO board, and there will be project using a RGB LED to reproduce detected colors. We hope you have found this Arduino RGB LED Circuit very useful. The analogWrite function is used to control the intensity of the colors by setting a value between 0 and 255, which determines the brightness of the RGB LED. The delay function is used to pause the program for a certain number of milliseconds, which allows you to control the duration that the LED is on or off. The digitalWrite the function is used to set the digital pin to a high or low state, which turns the RGB LED on or off. To control the LED, the code uses functions such as digitalWrite, delay, and analogWrite. ![]() The working of the source code to control an RGB LED is very simple. } When using many colors const int PIN_RED = 5 Arduino – RGB LED Example Code const int PIN_RED = 5 Now copy the following code and upload it to Arduino IDE Software. Here is a simple step-by-step guide on “ How to install Arduino IDE“. Make connections according to the circuit diagram given below.įirst, you need to install Arduino IDE Software from its official website Arduino.
0 Comments
Leave a Reply. |