Question: This short lab will allow the student to demonstrate the use of loops in basic C programming using the ATmega 3 2 8 P microcontroller

This short lab will allow the student to demonstrate the use of loops in basic C programming
using the ATmega328P microcontroller on an Arduino Uno R3 development platform.
Required Equipment
1- Laptop with functional Geany IDE, AVR toolchain and Make environment
1- Arduino Uno R31- USB Type A to B Cable
Procedure
Follow the steps below in creating your program:
Create a new folder named lab4 in your PROG1331 folder. Copy your C Source
template, makefile, and prog1331. h header into the new folder, then rename your C
Source file to:
"lastname_firstname_L4.c"
Make changes to the program flowerbox information to reflect the current file.
Ensure your template includes the AVR or C core libraries for I/O control, delay
functions, the standard I/O functions and the prog1331. h header file.
The template must also include the uart_init() function call and connect stdin and
stdout of the stdio.h header to the UART buffer locations.
Locate the pin assignment for the on-board LED of the Arduino Uno. Properly configure
the associated ATmega328P to allow control of the LED.
Create a generic structure for one of each of the following kinds of loops in the main
program while(1) loop; leave the test expressions and any other data blank for now:
a) WHILE loop
b) DO...WHILE loop
c) FOR loop.
Perform the following actions in each loop:
a) In the WHILE loop, create a serial print statement to print multiples of 5 from 0
to 100. Set up the conditions for the WHILE loop to execute the appropriate
number of times to accomplish this.
b) In the DO...WHILE loop, capture up to 3 consecutive values received from the
serial monitor (in separate variables). Print all 3 values back to the serial monitor
once the loop completes in ASCII format.
c) In the FOR loop, blink the LED on/off for 20 full cycles at a speed of 4Hz.
Send a message to the terminal indicating the program has completed. Prevent your
program from restarting after sending this message.
 This short lab will allow the student to demonstrate the use

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!