MCTE 4105 Mechatronics Lab Iii Sem Ii - Session 19/20 Title: Experiment 4: Input Switches and Output Leds
MCTE 4105 Mechatronics Lab Iii Sem Ii - Session 19/20 Title: Experiment 4: Input Switches and Output Leds
SEC 1 || GROUP 9
Start
End
8. DISCUSSION
In this experiment, we test how the microprocessor work with the
Atmel Studio 7.0 application. The Atmel application is application that
use assembly language which control directly to the output and input
port. We utilize port B, port C and port D in the Arduino UNO as output.
To turn on the pin at the output, we use the Atmel Studio to program the
flow work of the microprocessor.
For the first task, we set all the bit to high by setting the value to
$FF which make all 8 bits turned high. Then we set the value into port D
thus making it as output. Port C will become as input pin where we
connect it with switch. As there is high value comes from the switch after
we press it, the LED will be high. Second task relate to different input by
using two switches connect to Analog Input pinA2 and pinA3. The output
pin should be same with the input, pinD2 and pin3D. If only pinA2 is set
high from its pressed switch, the input from port C will be 00000010. The
value then be sent to port D which only pinD2 will be high thus the LED
attached to it will light on. The third experiment relate to delay where we
code the program to make the three LEDs will light on with delay.
Task1 :
Task2 :
Task 3:
9. CONCLUSION
To conclude, all three experiment is success with the LED give
the output according to the instruction thus showing the coding and
circuit’s set-up is in correct position. The using of assembly language is
should be done very carefully because of its critical detail. The using of
different pin or port may cause different result.