{"id":15832280,"url":"https://github.com/victor-lis/wifi_e_leds","last_synced_at":"2026-05-07T11:33:53.657Z","repository":{"id":207454457,"uuid":"719261631","full_name":"Victor-Lis/Wifi_e_Leds","owner":"Victor-Lis","description":null,"archived":false,"fork":false,"pushed_at":"2023-11-18T03:00:31.000Z","size":7,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-06T12:41:57.319Z","etag":null,"topics":["esp32","html-css-javascript","leds","robotics"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Victor-Lis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-11-15T19:55:22.000Z","updated_at":"2024-01-16T01:06:19.000Z","dependencies_parsed_at":"2023-11-18T04:22:23.339Z","dependency_job_id":"1a340a50-43b5-4d67-96b9-fe2b1a8480c9","html_url":"https://github.com/Victor-Lis/Wifi_e_Leds","commit_stats":null,"previous_names":["victor-lis/wifi_e_leds"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Victor-Lis/Wifi_e_Leds","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Victor-Lis%2FWifi_e_Leds","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Victor-Lis%2FWifi_e_Leds/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Victor-Lis%2FWifi_e_Leds/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Victor-Lis%2FWifi_e_Leds/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Victor-Lis","download_url":"https://codeload.github.com/Victor-Lis/Wifi_e_Leds/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Victor-Lis%2FWifi_e_Leds/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32735209,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-07T02:14:30.463Z","status":"ssl_error","status_checked_at":"2026-05-07T02:14:29.405Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["esp32","html-css-javascript","leds","robotics"],"created_at":"2024-10-05T12:41:35.864Z","updated_at":"2026-05-07T11:33:53.633Z","avatar_url":"https://github.com/Victor-Lis.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Conectando Wifi e alternando Leds\n\nEsse é um projeto que pra mim foi muito divertido de construir, pois interliguei um código compilado no esp32, que cria um servidor com base no próprio IP dele e na minha rede Wifi e através desse servidor, que eu enviei um site, consigo alternar leds!\n\n\n## Desafios\n\nAcredito que meus principais desafios nesse projeto foram:\n- Primeira vez utilizando o ESP(no caso o ESP32).\n- Primeira vez trabalhando com as entradas do ESP.\n- Primeira vez mexendo com Wifi.\n- Conectando Wifi na rede local.\n- Enviando informações via rede local.\n## Aprendizados\n\nPor final aprendi algumas coisas interessantes como: \n### Conectando o Esp32 ao meu Wifi\n\n```c++\n#include \u003cWiFi.h\u003e\n\nconst char* ssid     = \"------\";  // Your Network \nconst char* password = \"******\"; // Your Network Password \n\nconst int ledBlue = 26; // the number of the BLUE LED pin\nconst int ledRed = 27; // the number of the RED LED pin\n\nWiFiServer server(80);\n\nvoid setup()\n{\n    pinMode(ledBlue, OUTPUT); // Starting the PIN of blue led\n    pinMode(ledRed, OUTPUT); // Starting the PIN of red led\n    \n    Serial.begin(115200);\n\n    delay(10);\n\n    // We start by connecting to a WiFi network\n\n    Serial.print(\"Connecting to \");\n    Serial.println(ssid);\n\n    WiFi.begin(ssid, password); // Starting connection\n\n    while (WiFi.status() != WL_CONNECTED) {\n        // Loop while is connecting\n        delay(500);\n        Serial.print(\".\");\n    }\n\n    Serial.println(\"\");\n    Serial.println(\"WiFi connected.\");\n    Serial.println(\"IP address: \");\n    Serial.println(WiFi.localIP());\n    \n    server.begin();\n\n}\n\n```\n\n### Estilizando o site\nNesse trecho eu coloquei todo o código html da pasta \"Site\" em uma linha e printei ela no meu \"client\", ou seja, meu ip.\n```c++\nvoid loop(){\n    ...\n        client.print(\"\u003c!DOCTYPE html\u003e\u003chtml lang='pt-BR'\u003e\u003chead\u003e\u003cmeta charset='UTF-8'\u003e\u003cmeta name='viewport' content='width=device-width, initial-scale=1.0'\u003e\u003ctitle\u003eLeds\u003c/title\u003e\u003c/head\u003e\u003cstyle\u003e* {margin: 0;padding: 0;border: 0;font-family: sans-serif;}body {background-color: #202020;display: flex;flex-direction: column;align-items: center;justify-content: space-around;min-height: 80vh;padding: 10vh 0;}a {text-decoration: none;text-transform: uppercase;padding: 35px 50px;border: 2px solid #fff;font-size: 20px;color: #fff;transition: 0.25s;\u0026:hover {opacity: 0.75;cursor: pointer;transition: 0.5s;}} .blue {border: 2px solid rgb(0, 15, 255);\u0026:hover {background-color: rgb(0, 15, 255);}}.blue-active {background-color: rgb(0, 15, 255);}.red {border: 2px solid rgb(255, 15, 0);\u0026:hover {background-color: rgb(255, 15, 0);}}.red-active {background-color: rgb(255, 15, 0);}\u003c/style\u003e\u003cbody\u003e\u003ca class='blue' href='?led=blue'\u003e Blue \u003c/a\u003e\u003ca class='red' href='?led=red'\u003e Red \u003c/a\u003e\u003c/body\u003e\u003cscript\u003elet currentURL = window.location.href;if (currentURL.includes('blue')) {document.querySelector('.blue').classList.add('blue-active');}if (currentURL.includes('red')) {document.querySelector('.red').classList.add('red-active');}\u003c/script\u003e\u003c/html\u003e\");\n    ...\n}\n```\n\n### Recebendo valores da web\nNo trecho abaixo eu verifico se a url passa o parâmetro para o led \"red\"(ligando o led vermelho) ou \"blue\"(ligando o led azul).\n```c++\nvoid loop(){\n    ...\n    if (currentLine.endsWith(\"GET /?led=blue\")) {\n        Serial.println(\"Blue\");\n        digitalWrite(ledBlue, HIGH);   \n        digitalWrite(ledRed, LOW);   \n    }\n    if (currentLine.endsWith(\"GET /?led=red\")) {\n        Serial.println(\"Red\");\n        digitalWrite(ledBlue, LOW);   \n        digitalWrite(ledRed, HIGH);\n    }\n    ...\n}\n```\n# Resultado\n\n[Ver vídeo do projeto funcionando!](https://www.youtube.com/watch?v=S7EanehuTS0)\n## Autores\n\n- [@Victor-Lis](https://github.com/Victor-Lis)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvictor-lis%2Fwifi_e_leds","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvictor-lis%2Fwifi_e_leds","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvictor-lis%2Fwifi_e_leds/lists"}