Unfortunately, my project failed but I can express what I have tried to create. Ezo has many abilities the common one is talking to you like a friend and answering any of your questions remembering things and having the freedom to look around and understand the surroundings and it can show faces based on the situation and your answer Now the cool part comes where Ezo now has pins on it and can control them according to your order so if you do not know C++ Ezo can help your simple projects come to life.
COMPONENTS REQUIRED:
12 v motors
12v battery
Wires (jumper and solid core)
To see the full demonstration video, click on the YouTube Video below
CIRCUIT DIAGRAM:
CODE EXPLAINATION:
The code I could write:
#include <WiFi.h> // Include Wi-Fi library toconnect to Wi-Fi networks#include <HttpClient.h> // Include HTTP clientlibrary for HTTP requests// WiFi credentialschar ssid[] = "yourSSID"; // Wi-Fi network namechar password[] = "yourPassword"; // Wi-Fipassword// Server and API detailsconst char* server = "api.openai.com"; //OpenAI API serverconst int port = 443; // Port for HTTPS (securecommunication)const char* apiUrl = "/v1/chat/completions"; //API endpoint for ChatGPTconst char* apiKey = "yourApiKey"; // API keyfor authorization// Initialize WiFi and HTTP clientsWiFiClient wifiClient; // WiFi client to managenetwork connectionHttpClient httpClient(wifiClient); // HTTP clientfor sending requests over WiFivoid setup() {Serial.begin(9600); // Start serialcommunication at 9600 baud rate// Connect to WiFiSerial.print("Connecting to WiFi...");WiFi.begin(ssid, password); // Begin WiFiconnectionwhile (WiFi.status() != WL_CONNECTED) { //Wait until connecteddelay(500);Serial.print("."); // Print dots while waiting}Serial.println("\nConnected to WiFi"); // Confirmconnection}String chatWithGPT(String userInput) {// Prepare JSON data for the API request,embedding user inputString jsonData = "{\"model\": \"gpt-3.5-turbo\",\"messages\": [{\"role\": \"user\", \"content\": \"" +userInput + "\"}]}";const char* jsonDataCStr = jsonData.c_str(); //Convert JSON data to C string// Send POST request to OpenAI APIhttpClient.beginRequest(); // Start the requesthttpClient.post(server, port, apiUrl,jsonDataCStr); // Send POST request withserver, port, and URL// Add HTTP headershttpClient.sendHeader("Authorization", ("Bearer" + String(apiKey)).c_str()); // API authorizationhttpClient.sendHeader("Content-Type","application/json"); // Data typehttpClient.sendHeader("Content-Length",strlen(jsonDataCStr)); // Data length// End request and receive responsehttpClient.endRequest(); // Complete the HTTPrequestString response = httpClient.readString(); //Read the response from the serverreturn response; // Return response as a string}void loop() {String userInput = "Hello, ChatGPT!"; // Sampleinput message to ChatGPTString response = chatWithGPT(userInput); //Call function to send message and getresponseSerial.println("ChatGPT response: " +response); // Print ChatGPT's response toSerial Monitordelay(10000); // Wait 10 seconds beforesending the next request}
PICTURE OF THE DELIVERY:
