Mircoprocessor
Mircoprocessor
Mircoprocessor
Create a circuit as shown in Fig. 2 on the breadboard. To build the circuit, attach a
resistor to pin 13. Then attach the long leg of an LED (the positive leg, called the anode)
to the resistor. Attach the short leg (the negative leg, called the cathode) to ground.
Then plug your Arduino board into your computer via USB.
Start the Arduino software and enter the code as follows. After creating the sketch, click
on Compile button. If there is any error, debug the error in your sketch. After the status
display at the bottom of the Arduino software say “Done Compiling”, then click on the
Upload button. The TX and RX led’s should start flashing to indicate that the program is
being uploaded to the flash memory of the ATmega2560 microcontroller. (Tip: Can
be found in File>Examples>Basic>Blink).
Next is Create an Arduino code that will make a single LED on for 10 seconds and off
for 2 seconds repeatedly.
Discussion:
1. What is Arduino?
2. What is a sketch? What are the settings that must be checked in order to
successfully upload a sketch to an Arduino board?
3. List and briefly describe the toolbar buttons commonly used in the Arduino
development environment.
4. What is the difference between the void setup () and void loop()sections in
an Arduino sketch?
5. What does the function pinMode()do? Briefly explain the parameters that are
passed to this function.
6. What does the function int do? Briefly explain the parameters that are
passed to this function.
7.Explain the advantage and disadvantage of not using the delay()function in a
sketch which requires the use of time delays.
8. What does the function digitalRead()and digitalWrite()do?
Conclusion: