Created
November 29, 2019 09:38
-
-
Save mgulsoy/b266b2223f0e8d27d6a4e5c2cf239516 to your computer and use it in GitHub Desktop.
Gatt Server Loop Fonksiyonu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void loop(){ | |
... | |
... | |
int pil_seviyesi_adc = analogRead(pil_olcum_pini); | |
uint8_t pil_seviyesi = map (pil_seviyesi_adc, 0, 4096, 0, 100); | |
pBatteryLevelCharx->setValue(&pil_seviyesi, 1); //sadece READ işlemi yapılacak | |
if( digitalRead(sensor_pin) == HIGH ) { | |
pSensorValueCharx->setValue("Acik"); | |
} else { | |
pSensorValueCharx->setValue("Kapali"); | |
} | |
if (ble2902.getNotifications() == true) { | |
pSensorValueCharx->notify(); //Bildir! | |
} | |
delay(1000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment