LiquidCrystal lcd ( 12, 11, 5, 4, 3, 2 ) /* Assigning the pins of Arduinofor connecting it with LCD*/ To control the brightness of LED and displaying its values on LCD using Arduino Uno we have written the code which is given below: How to write Arduino code for controlling the brightness of LED and display it on LCD using potentiometer We have supplied 5 volts to the topmost pin rows of the breadboard using the 5 volt pin of Arduino and from there we have connected each component with supply. To control the LED we have connected one pin to Arduino using pin 6 whereas the other pin of the LED is connected to ground using the ground pin of Arduino. However, the register select and enable pin of LCD is connected to Arduino using the gray wires on its 12 and 11 pins. The purple wires in the hardware assembly are used to connect the data pins of LCD to Arduino using its 5,4,3,2 pins. The output of the first potentiometer is connected to the V0 pin of the LCD using the green color wire. Since the potentiometer is an analog device, we have connected the output of the second potentiometer on the analog pin A0 of the Arduino using the blue color wire. In the above figure you can see we have used two potentiometers one is used to control the brightness of LCD and the other one is used to adjust the brightness of LED. The image below is the hardware assembly for the circuit that displays brightness values of LED on LCD: How to create hardware for displaying the LED brightness values on LCDįor displaying the brightness values of LED on 16×2 LCD we have assembled the circuit according to the schematic given above. To alter the brightness and display the values on the LCD we have first created a circuit whose schematic is given below followed by the components that we have used in the circuit: How to display brightness values of LED on 16×2 LCD As described above the displays are used to display the input and output of a program so we have also displayed the values of brightness of LED on 16×2 LCD. The display mostly used in the Arduino related projects is the 16×2 LCD. There are different ways by which we can display the data, one of which is by creating a status bar of the values and displaying it on LCD. Displaying the inputs and outputs of an Arduino program makes the project easier to understand and gives it a cooler look.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |