In: Electrical Engineering
1(a). You are required to interface and write sample programme to test the operation of the following devices of the microcontroller board, namely (i) Push Buttons (ii) LEDs (iii) Analog input (using the potentiometer)
(b). A LED is to be interfaced to pin 3 of the microcontroller board. Please draw the necessary hardware circuit to show the connection. Write a sample software to glow the LED with ON time 1 sec and OFF time 1 sec.
(microcontroller is Arduino)
1a) i) The program to interface the pushbutton is shown below.
program is based on switching of pushbutton. the LED is taken as output , for every push of button the led glows.
ii ) The program for LEDs is shown below
the program is done inorder to check the output of LEDs, they are programmed in a way that each of them blink for 2 seconds and turn off.
iii) The program to measure analog value is shown below.
the program is done, based on the output of the potentiometer. the change in output of potentiometer changes the output of arduino.
ANSWER for (b)
GIVEN conditions LED to glow 1 sec and off for 1 sec .
the program for above condition is as follows;
The following picture shows the connection of led ,
The following programs are done in arduino software in order to make sure the provided program is with out errors.