aboutsummaryrefslogtreecommitdiff
path: root/Mussel
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2025-04-13 17:24:55 +0200
committerJonas Smedegaard <dr@jones.dk>2025-04-13 17:24:55 +0200
commitdc7d7326c3768f37a8ebfca5faee0486297ac7b0 (patch)
tree2ea7a1d99b569ee9a330d21fce48606219dcb543 /Mussel
parented3ac0eb11a04630f7f08124a484a854eea13569 (diff)
define instantiate general code before local
Diffstat (limited to 'Mussel')
-rw-r--r--Mussel/examples/sensor/sensor.ino6
-rw-r--r--Mussel/examples/vote/vote.ino5
2 files changed, 6 insertions, 5 deletions
diff --git a/Mussel/examples/sensor/sensor.ino b/Mussel/examples/sensor/sensor.ino
index 73e0966..77b443f 100644
--- a/Mussel/examples/sensor/sensor.ino
+++ b/Mussel/examples/sensor/sensor.ino
@@ -3,14 +3,12 @@
EddystoneTLM frame specification https://github.com/google/eddystone/blob/master/eddystone-tlm/tlm-plain.md
*/
-#include <Mussel.h>
-
#include "BLEDevice.h"
#include "BLEBeacon.h"
#include "BLEAdvertising.h"
#include "BLEEddystoneTLM.h"
-Mussel mussel(2);
+#include <Mussel.h>
#define BEACON_POWER ESP_PWR_LVL_N12
@@ -20,6 +18,8 @@ BLEAdvertising *pAdvertising;
#define BEACON_UUID "8ec76ea3-6668-48da-9866-75be8bc86f4d" // UUID 1 128-Bit (may use linux tool uuidgen or random numbers via https://www.uuidgenerator.net/)
+Mussel mussel(2);
+
// Check
// https://github.com/google/eddystone/blob/master/eddystone-tlm/tlm-plain.md
// and http://www.hugi.scene.org/online/coding/hugi%2015%20-%20cmtadfix.htm
diff --git a/Mussel/examples/vote/vote.ino b/Mussel/examples/vote/vote.ino
index 25c4720..ec9d185 100644
--- a/Mussel/examples/vote/vote.ino
+++ b/Mussel/examples/vote/vote.ino
@@ -5,7 +5,6 @@
Upgraded Eddystone part by Tomas Pilny on Feb 20, 2023
*/
-#include <Mussel.h>
#include <Arduino.h>
#include <BLEDevice.h>
@@ -14,11 +13,13 @@
#include <BLEEddystoneTLM.h>
#include <BLEBeacon.h>
-Mussel mussel(10);
+#include <Mussel.h>
int scanTime = 1; //In seconds
BLEScan *pBLEScan;
+Mussel mussel(10);
+
class MyAdvertisedDeviceCallbacks : public BLEAdvertisedDeviceCallbacks {
void onResult(BLEAdvertisedDevice advertisedDevice) {
if (advertisedDevice.haveName()