I am developing an application to read a barcode and send the code to the ESP32 Wroom 32u, but I am not finding the options to send the result to the Bluetooth device.
Does anyone know how to create the code block to get the result read by the scanner and send it to the Bluetooth device (ESP32)?
Use Sensors / BarcodeScanner.
Then send the text result to ESP2 via BLE (extension) or Classic Bluetooth
2.- App send text to ESP32. Show on the Serial Monitor.
p110i_esp32_ble_enviar.aia (220.5 KB)
[appinventoresp32ble9]
Write and Send a text.
Texts are sent in packages of 20 characters.
Send: “El Ñandú corrió por Cádiz”
Receive: “El Ñandú corrió p” = 17 chars + special chars: Ñ,ú,ó need 2 bytes.
[appinventoresp32ble2i]
/*
Based on Neil Kolban example for IDF:
https://github.com/nkolban/esp32-snippets/blob/master/cpp_utils/tests/BLE%20Tests/SampleWrite.cpp
Ported to Arduino ESP32…
1.- App sends a LED4 on/LED4 off to ESP32 by classic Bluetooth.
p62D_esp32_bluetooth_1.aia (2.7 KB)
[esp32_bluetooth10]
App sends "1", LED4 ON, and get a response: "LED4 is ON".
App sends "0", LED4 OFF, and get a response: "LED4 is OFF".
App sends "3", get status LED4.
[esp32_bluetooth_3b]
ESP32, look loop():
#include "BluetoothSerial.h"
#define LED4 4
BluetoothSerial SerialBT;
void setup() {
Serial.begin(115200);
initBT();
pinMode(LED4, OUTPUT);
}
void initBT(){
if(!SerialB…
1 Like
Hi Juan, tks!
Im trying to send the barcode for bluetooth to ESP32 wroom 32u. Its not working.
Can you help me?
Look the blocks.
Sorry this is not english, im brazilian.
tks.
Here an example:
5.- App gets the text of a QR using BarcodeScanner. Send that text to ESP32.
If you use recent versions of Android you must configure Bluetooh permissions. Search this Community.