SWEN-340

Data Representation Homework

Overview

This homework is to implement a version of printf that will work with your microcontroller.

Setup

Using the provided USART_Write function (UART.h), create a printf function using variable arguments and the vsprintf function. Your printf should have a declaration in printf.h and the implementation in printf.c. Look at the example in the UART Overview slides on how to use vsprintf and variable number arguments. The big difference between the example and the activity is instead of only storing the string in a buffer it needs to use USART_Write to write it to the terminal. Verify your new printf works by using it to print "Hello, World!" in your project.c file. Call the project's run method from main to ensure it is correctly printing.

Extra-Credit (10 Points)

Name your printf function printf. Fix any issues that you encounter with it.

We will discuss the issues in class and solutions, you will need to make sure they are in place in your solution as well.

Submission

Submit the homework by pushing any changes to the course repository by the deadline.