aboutsummaryrefslogtreecommitdiff
path: root/Mussel/examples/vote/vote.ino
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2025-04-18 01:24:05 +0200
committerJonas Smedegaard <dr@jones.dk>2025-04-18 01:24:05 +0200
commit6ca4ff06867aa5d7354615c828bd83234d827ff2 (patch)
tree6a42f307f09e05491f8e1eb9bf157e13916dad8d /Mussel/examples/vote/vote.ino
parentea3988c911b467cbabe38cb9c3e6d0013b53965d (diff)
rop Mussel library; move Arduino sketches below Arduino/
Diffstat (limited to 'Mussel/examples/vote/vote.ino')
-rw-r--r--Mussel/examples/vote/vote.ino56
1 files changed, 0 insertions, 56 deletions
diff --git a/Mussel/examples/vote/vote.ino b/Mussel/examples/vote/vote.ino
deleted file mode 100644
index ec9d185..0000000
--- a/Mussel/examples/vote/vote.ino
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- Based on Neil Kolban example for IDF: https://github.com/nkolban/esp32-snippets/blob/master/cpp_utils/tests/BLE%20Tests/SampleScan.cpp
- Ported to Arduino ESP32 by Evandro Copercini
- Changed to a beacon scanner to report iBeacon, EddystoneURL and EddystoneTLM beacons by beegee-tokyo
- Upgraded Eddystone part by Tomas Pilny on Feb 20, 2023
-*/
-
-#include <Arduino.h>
-
-#include <BLEDevice.h>
-#include <BLEScan.h>
-#include <BLEAdvertisedDevice.h>
-#include <BLEEddystoneTLM.h>
-#include <BLEBeacon.h>
-
-#include <Mussel.h>
-
-int scanTime = 1; //In seconds
-BLEScan *pBLEScan;
-
-Mussel mussel(10);
-
-class MyAdvertisedDeviceCallbacks : public BLEAdvertisedDeviceCallbacks {
- void onResult(BLEAdvertisedDevice advertisedDevice) {
- if (advertisedDevice.haveName()
- && advertisedDevice.getFrameType() == BLE_EDDYSTONE_TLM_FRAME
- ) {
- BLEEddystoneTLM EddystoneTLM(&advertisedDevice);
- mussel.push(
- advertisedDevice.getName(),
- millis(),
- EddystoneTLM.getTemp()
- );
- }
- }
-};
-
-void setup() {
- Serial.begin(115200);
- mussel.begin();
-
- BLEDevice::init("");
- pBLEScan = BLEDevice::getScan(); //create new scan
- pBLEScan->setAdvertisedDeviceCallbacks(new MyAdvertisedDeviceCallbacks());
- pBLEScan->setActiveScan(true); //active scan uses more power, but get results faster
- pBLEScan->setInterval(100);
- pBLEScan->setWindow(99); // less or equal setInterval value
-}
-
-void loop() {
- // put your main code here, to run repeatedly:
- BLEScanResults *foundDevices = pBLEScan->start(scanTime, false);
- pBLEScan->clearResults(); // delete results fromBLEScan buffer to release memory
- mussel.printStack();
- delay(500);
-}