Wednesday, June 5, 2019

RBG Colour Model Experiment

RBG Colour Model ExperimentIntroductionColor is a visual attribute of objects that results from the light they emit, transmit or reflect. 1 These colors give us the ability to appreciate things around us. With this, we can easily define or give meaning to the things we see almost every day. We can see these colors in paintings, surroundings, the food we eat, and almost everything, as almost everything has color. Electronic systems drill different color models to represent data visually. 2 One of these color models is RGB color model. A color in RGB color model is expressed by how more than of each red, verdancy, blue is included 2, hence the acronym RGB. In this experimentation, we lit the RGB LED with different colors in Arduino, with the use of RGB color model.Materials with DescriptionDFRduino Uno R3 (1)The arduino circuit board. pinny Cables M/M (4)Serves as the connector to different pins in the circuit.RGB LED (1)A diode that emits light and to be used as an output in the c ircuit. It provides different colors of light by setting its RGB (Red, Green, Blue) values. It consists of 3 anodes, one for each color in RGB, and one cathode.220 Resistor (3)An electric device that lead control the flow of current through the circuit.Procedure (self-explained)Connect the components to the breadboard base on the tables below.Resistor breadboardStartEndAD9G9BD7G7CD6G6Table 1 Resistor PositionsRGB LEDRedCathode(-)GreenBlueBreadboardI9I8I7I6Table 2 RGB Led Position sweater WiresBreadboardArduinoStartEnd1C6DP 102C7DP 113C9DP 94H8GNDTable 3 Jumper Wire PositionsAfter plotting the components to the breadboard. Connect the USB cable to the computer and the circuit.Compile and upload the code.Circuit DiagramCodeCode Analysis int redPin, greenPin, bluePin this code sets the pin progenys game of each color from RGB LED to their respective pin slot in the Arduino.void setup() a one-time initialization method. Set all redPin, greenPin, and bluePin as output by using pinMod e(pin, pinType) built-in take to the woods.void loop() a method that constantly iterates the statements inside the block. In this experiment, we created different colors, by generating random numbers from random(min, max) each color from red, green and blue.random(0, 255) a built-in function that generates random number from range 0 to 255.void colorRGB(int r, int g, int b) a user-defined method that accepts values of r, g, and b. This method is also responsible for charge the values/colors for the pins of the RGB LED by using analogWrite(pin, value). When these colors are combined together, the RGB LED leave create a different color ground on the values of the RGB written by analogWrite().constrain(value, min, max) a built-in function that checks whether value is in the range of min and max. If so, return the value. If value is greater than max, this function will return max. If value is less than min, this function will return min. This code is essential to check whether the v alue is less than 0 or greater than 255, as analogWrite can only accept values 0-255. Also, the color values for each color in RGB can only be 0 255. For typesetters case R = 255, G = 0, B = 255, this will create a violet color.delay(n) lets the circuit sleep or pause for n milliseconds.Comparison of Code vs. computer hardware OutputIt is noticeable that the code controls and manages how will the hardware provide an output. It is also important that the pins used in the hardware should be the same in the code. This experiment introduced a new kind of LED that can represent or display different colors. The RGB LED changes its color by using random number generation as part of the code, and setting those values to each color in RGB pins in the LED.Recommendation/EnhancementThe experiment can be integrate in disco bars, to produce different colors of lights. This can be also used for medical purposes for people who may suffer color blindness. For example, an RGB LED, will produce co lors, and the individual will describe the color he or she saw. A billboard composed of multiple RGB LEDs can be used to puzzle out like as pixels in a graphic image.1WordNet Search 3.1, Online. Available http//wordnetweb.princeton.edu/perl/webwn?s=colorsub=Search+WordNeto2=o0=1o8=1o1=1o7=o5=o9=o6=o3=o4=h=.2RGB Color Model Wikipedia, Online. Available https//en.wikipedia.org/wiki/RGB_color_model. Accessed 9 January 2017.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.