Lab 6 AI Prototype
Beautify my Website
Learning Goals
The goal of this prototype is to experiment with using AI as a coding assistant to generate code. Through the various previous prototypes, you should have a good idea of the performance of LLMs in writing SystemVerilog and C. For this prototype, you will give the LLM a task that it is (generally) considered to be more proficient at: frontend websites. By the end of this experiment you should be able to:
- Demonstrate how an LLM can be used as a coding partner.
- Realize the strengths and weaknesses of LLMs.
- Analyze the quality of the LLM-generated code.
- Document specific tips on how to use the LLM effectively.
Prototype
Fire up your favorite LLM. ChatGPT is a good place to start, but you may consider using other LLMs as well like Claude or Gemini. Enter the prompt below.
I’m making a web portal to interface with a temperature sensor. Create a HTML page that looks good and is intuitive to show the temperature, control an LED, and change the precision of the readout.
Once the LLM responds, add in the code to your web server. How does it look? Does the output make sense?
Compare this result with the outputs for this subsequent prompt:
Write me a C function to carry out a SPI transaction to retrieve a temperature reading from a DS1722 sensor. Make use of CMSIS libraries for the STM32L432KC.
How did it perform in this case? Was the code reasonable? Does it work when plugged into the project?
Reflect
Write up a few paragraphs reflecting on your experience using the LLM to help you code. Feel free to make full use of screenshots, code snippets, and other media as you write your reflections.
Here are a few ideas of on what you might comment on:
- How would you rate the quality of the output and why?
- Did the LLM generate any code for you? If so, how does it compare to your setup?
- How does the LLM’s explanation compare to your reasoning for choosing your timer?
- Does the LLM work well as a sounding board, rather than a code generator as used in previous prototypes?