Gist 82d472ceee4909cc7880ce2b2e0885dc
✓ Published0🌍 Public
IIoTeacher
Last edited Nov 6, 2025
Created on Nov 6, 2025
This example shows a MicroPython learning activity where an ESP32 or Raspberry Pi Pico W sends prompts to the OpenAI ChatGPT API and displays the text response on an SSD1306 OLED display via I²C. The code uses `network.WLAN` for Wi-Fi connectivity, `urequests.post` to call the chat completions endpoint, and `SSD1306_I2C` from the `ssd1306` library to render the reply. The demonstration includes connection setup, JSON response parsing, and a simple text-wrapping routine for the OLED’s 16-character line width, with optional scroll or truncation for longer answers.
AI-generated description