DaveLoading/M5Core2-Open-AI-Tour-Guide
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
Final Lab GPT Tour Guide ======================== David Shamas CSC230 – Internet of Things Professor Prator --------------------------------- Introduction --------------------------------- This project showcases the M5Core2 microcontroller and the OpenAI API to create a simple, location-based tour guide. The device connects to Wi-Fi, retrieves your GPS coordinates, and uses AI to provide local food recommendations, state news, and upcoming events. If GPS fails, the program falls back to Phoenix, Arizona (set in secrets.h). The interface includes three buttons: - A: Food - B: News - C: Events Results display in yellow text in a scrollable area, navigable by dragging on the touchscreen. --------------------------------- Features --------------------------------- - Wi-Fi + OpenAI API Integration for AI-driven responses - GPS Tracking with a fallback location - Interactive UI with header, footer, and touch-based scrolling - Three Prompt Options: Top restaurants, news, and events - API Key Security: Keys stored in secrets.h --------------------------------- Implementation --------------------------------- Tools & Libraries: - PlatformIO (Arduino framework) - M5Stack Core2 microcontroller - TinyGPSPlus library for GPS - OpenAI API for responses - Wi-Fi connectivity Hardware Used: - M5Core2 microcontroller - USB-C cable - GPS module (Port C, RX=13, TX=14) --------------------------------- File Structure --------------------------------- /Final-Lab-GPT-Tour-Guide ├── main.cpp # Main application logic ├── secrets.h # Wi-Fi credentials & fallback location └── readme.txt # Project documentation --------------------------------- How It Works --------------------------------- 1. Connect the M5Core2 to Wi-Fi using credentials in secrets.h. 2. Poll GPS coordinates; fallback location is Phoenix, AZ. 3. Press A, B, or C to get location-based responses: - A → Top 3 local restaurants - B → State news summary - C → Top 3 upcoming events 4. AI responses appear on-screen and can be scrolled with touch gestures. --------------------------------- Setup Instructions --------------------------------- 1. Install PlatformIO and open the project. 2. Add your Wi-Fi credentials and OpenAI API key in secrets.h: #define SECRET_SSID "YourWiFiName" #define SECRET_PASS "YourWiFiPassword" #define OPENAI_API_KEY "YourAPIKey" 3. Build and upload the project to your M5Core2. 4. Run the program, press buttons, and explore local info! --------------------------------- Demo Video --------------------------------- https://youtube.com/shorts/nM2Bj-F7bLo?feature=share --------------------------------- I used ChatGPT as a debugging and feature-integration tool. The code was not copy-pasted but developed with AI assistance to speed up learning and implementation.