A brief introduction to what we’ll do.

Untitled

This guide helps you connect Open AI’s cloud API to an Arduino Microcontroller by using p5.js (Processing) as a pass through to make the request

We need a p5.js (or Processing) sketch running in our browser because our Arduino board doesn’t have a wifi module.

So instead, the Processing sketch will open Serial communications to the microcontroller and listen for a serial message that indicates it should make a request to Open AI’s API

Once the API request is returned, the p5.js script will send the response to the Arduino by posting a serial message. The Arduino, connected via USB to the laptop where the p5.js script is running, will receive the message on the serial port, and act accordingly.

Exploring Open AI

It’s helpful to start exploring Open AI through their Playground at: https://platform.openai.com/playground

This gives a quick way to explore and design prompts for text generation and tune the parameters you’ll want to use for your project.

Screenshot 2023-03-15 at 9.25.31 AM.png

If you’d like to learn more about text completion with OpenAI they provide a helpful guide:

OpenAI API

You might notice a series of parameters along the right hand side bar. These will let you choose and tune the responses you get.