0% found this document useful (0 votes)
8 views9 pages

Instalación ESP32-S3

The document provides a step-by-step guide for setting up an ESP32S3 module with Arduino IDE, including driver installation, board configuration, and code examples for a simple LED program and Bluetooth communication. It also includes instructions for downloading a specific Android app to facilitate Bluetooth interactions. Finally, it outlines how to send data from the Arduino serial monitor to the connected mobile device via Bluetooth.

Uploaded by

ga400752
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views9 pages

Instalación ESP32-S3

The document provides a step-by-step guide for setting up an ESP32S3 module with Arduino IDE, including driver installation, board configuration, and code examples for a simple LED program and Bluetooth communication. It also includes instructions for downloading a specific Android app to facilitate Bluetooth interactions. Finally, it outlines how to send data from the Arduino serial monitor to the connected mobile device via Bluetooth.

Uploaded by

ga400752
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

1. Instalar el driver CH343→https://www.wch-ic.com/products/CH343.

html

2. Instalar IDE Arduino→https://www.arduino.cc/en/software

3. Una vez instalado el IDE seguir la ruta siguiente:

File→Preferences→Settins→Additional boards manger URLs y pegar la siguiente dirección:

https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json

→ Ok
4. Seguir la ruta Tools→Board→Boards Manger
5. Buscar ESP32 →Instalar

6. Seleccionar Tools→Board”Arduino uno”→esp32→ESP32S3 Dev Module


7. Conectar el módulo al pc por medio del cable Tipo C, y verificar la instalación este correcta
8. Seleccionar Tools→ Upload Mode

9. Seleccionar el puerto COM correcto


10. Seleccionar la velocidad de carga del programa

11. Ya tienes todo Listo para tu primer programa.

12. Mi primer programa

#define LED_BUILTIN 2
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
}

// the loop function runs over and over again forever


void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}

13. Descargar e instalar la siguiente app para android

https://play.google.com/store/search?q=lightblue&c=apps&hl=es_419&gl=US
14. Escribir y cargar el siguiente código en el IDE de Arduino y al modulo ESP32S3

#include "BLEDevice.h"

#include "BLEServer.h"

#include "BLEUtils.h"

#include "BLE2902.h"

#include "String.h"

BLECharacteristic *pCharacteristic;

bool deviceConnected = false;

uint8_t txValue = 0;

long lastMsg = 0;

String rxload="Test\n";

#define SERVICE_UUID "6E400001-B5A3-F393-E0A9-E50E24DCCA9E"

#define CHARACTERISTIC_UUID_RX "6E400002-B5A3-F393-E0A9-E50E24DCCA9E"

#define CHARACTERISTIC_UUID_TX "6E400003-B5A3-F393-E0A9-E50E24DCCA9E"

class MyServerCallbacks: public BLEServerCallbacks {

void onConnect(BLEServer* pServer) {

deviceConnected = true;

};

void onDisconnect(BLEServer* pServer) {

deviceConnected = false;

};

class MyCallbacks: public BLECharacteristicCallbacks {

void onWrite(BLECharacteristic *pCharacteristic) {

std::string rxValue = pCharacteristic->getValue();

if (rxValue.length() > 0) {

rxload="";

for (int i = 0; i < rxValue.length(); i++){

rxload +=(char)rxValue[i];

}
}

};

void setupBLE(String BLEName){

const char *ble_name=BLEName.c_str();

BLEDevice::init(ble_name);

BLEServer *pServer = BLEDevice::createServer();

pServer->setCallbacks(new MyServerCallbacks());

BLEService *pService = pServer->createService(SERVICE_UUID);

pCharacteristic= pService->createCharacteristic(CHARACTERISTIC_UUID_TX,BLECharacteristic::PROPERTY_NOTIFY);

pCharacteristic->addDescriptor(new BLE2902());

BLECharacteristic *pCharacteristic = pService-


>createCharacteristic(CHARACTERISTIC_UUID_RX,BLECharacteristic::PROPERTY_WRITE);

pCharacteristic->setCallbacks(new MyCallbacks());

pService->start();

pServer->getAdvertising()->start();

Serial.println("Waiting a client connection to notify...");

void setup() {

Serial.begin(115200);

setupBLE("ESP32S3_Bluetooth");

void loop() {

long now = millis();

if (now - lastMsg > 100) {

if (deviceConnected&&rxload.length()>0) {

Serial.println(rxload);

rxload="";

if(Serial.available()>0){

String str=Serial.readString();
const char *newValue=str.c_str();

pCharacteristic->setValue(newValue);

pCharacteristic->notify();

lastMsg = now;

15. Encender el bluetooth del celular y abrir la app, enseguida seleccionar la opción de recibir
16. Abrir el monitor serial del IDE Arduino.
17. Escribe una palabra y mándala por el monitor serial.
18.

You might also like