File tree Expand file tree Collapse file tree 3 files changed +12
-8
lines changed
Comunicaciones/Bluetooth/BLEscanESP32 Expand file tree Collapse file tree 3 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -35,12 +35,15 @@ void setup() {
3535}
3636
3737void loop () {
38+ /* Version 2
3839 BLEScanResults dispositivosEncontrados = pBLEScan->start(scanTime, false);
40+ */
41+ BLEScanResults *dispositivosEncontrados = pBLEScan->start (scanTime, false );
3942 Serial.print (" Dispositivos encontrados: " );
40- Serial.println (dispositivosEncontrados. getCount ());
41- for (int i=0 ; i<dispositivosEncontrados. getCount (); i++)
43+ Serial.println (dispositivosEncontrados-> getCount ());
44+ for (int i=0 ; i<dispositivosEncontrados-> getCount (); i++)
4245 {
43- BLEAdvertisedDevice dispositivo = dispositivosEncontrados. getDevice (i);
46+ BLEAdvertisedDevice dispositivo = dispositivosEncontrados-> getDevice (i);
4447 Serial.printf (" %d Nombre: %s \n " , i+1 , dispositivo.getName ().c_str ());
4548 Serial.printf (" \t Dirección: %s \n " , dispositivo.getAddress ().toString ().c_str ());
4649 if (dispositivo.haveTXPower ())
Original file line number Diff line number Diff line change @@ -33,9 +33,12 @@ void setup() // configuracion placa
3333 #if defined(PLAT_ARDUINO)
3434 Serial.begin (9600 );
3535 #else
36+ /* Version antigua V2
3637 ledcSetup(0, 0, 10);
3738 ledcAttachPin(BZ, 0);
38-
39+ */
40+ ledcAttachChannel (BZ,0 ,10 ,0 );
41+
3942 Serial.begin (115200 );
4043 #endif
4144}
Original file line number Diff line number Diff line change @@ -21,14 +21,12 @@ void setup() // configuracion placa
2121 // También cambiaríamos la velocidad del puerto de consola segun plataforma
2222 #if defined(PLAT_ARDUINO)
2323 Serial.begin (9600 );
24+ pinMode ( BZ , OUTPUT); // Buzzer se define como salida
2425 #else
2526 Serial.begin (115200 );
2627 pinMode (BZ, OUTPUT);
27- ledcAttachPin (BZ, 0 ); // Enlazamos Pin con canal 0
28+ ledcAttach (BZ, 1000 , 8 );
2829 #endif
29-
30-
31- pinMode ( BZ , OUTPUT); // Buzzer se define como salida
3230}
3331
3432void loop () // Se repite indefinidamente,
You can’t perform that action at this time.
0 commit comments