Category : arduino-esp32

Currently i am using below code to check if any ble device is present around. #include <BLEAdvertisedDevice.h> #include <BLEDevice.h> #include <BLEScan.h> const int PIN = 2; const int CUTOFF = -60; void setup() { pinMode(PIN, OUTPUT); BLEDevice::init(""); } void loop() { BLEScan *scan = BLEDevice::getScan(); scan->setActiveScan(true); BLEScanResults results = scan->start(1); int best = CUTOFF; for ..

Read more

This is a part of Arduino program(C++). MCU is ESP32. I have defined a class. Inside it I have created an array of member functions. class IRDN_Padidar_Zone { bool callAnimation(); uint16_t Animate_None(enum_Effect inOut); uint16_t Animate_Print(enum_Effect inOut); uint16_t Animate_Print_Random(enum_Effect inOut); uint16_t Animate_Print_Barfak(enum_Effect inOut); uint16_t Animate_Print_Laser(enum_Effect inOut); typedef uint16_t (IRDN_Padidar_Zone::*animatFunction)(enum_Effect); animatFunction animations[] = {&IRDN_Padidar_Zone::Animate_None,&IRDN_Padidar_Zone::Animate_Print,&IRDN_Padidar_Zone::Animate_Print_Random,&IRDN_Padidar_Zone::Animate_Print_Barfak,&IRDN_Padidar_Zone::Animate_Print_Laser}; }; bool IRDN_Padidar_Zone::callAnimation(enum_Effect ..

Read more