//Sensor Data or Command To App 31/01/2022 01:29:08 #include "BluetoothSerial.h" #if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED) #error Bluetooth is not enabled! Please run `make menuconfig` to and enable it #endif #ifdef __cplusplus extern "C" { #endif uint8_t temprature_sens_read(); //ESP32 internal temperature sensor #ifdef __cplusplus } #endif unsigned long lgUpdateTime; #define BTN1 digitalRead(0)==0 #define BTN2 digitalRead(35)==0 uint8_t temprature_sens_read(); BluetoothSerial SerialBT; void IRAM_ATTR isr() { SerialBT.println("A"); detachInterrupt(0); } void IRAM_ATTR isr2() { SerialBT.println("B"); detachInterrupt(35); } void setup() { // put your setup code here, to run once: lgUpdateTime = millis(); Serial.begin(115200); SerialBT.begin("ESP32"); pinMode(0,INPUT); pinMode(35,INPUT); attachInterrupt(0, isr, FALLING); attachInterrupt(35, isr2, FALLING); } void loop() { // put your main code here, to run repeatedly: attachInterrupt(0,isr,FALLING); attachInterrupt(35,isr2,FALLING); if(millis() - lgUpdateTime > 2000) //Loop approx every 2 seconds { lgUpdateTime = millis(); SerialBT.println((temprature_sens_read() - 32) / 1.8); } }