diff options
author | Jonas Smedegaard <dr@jones.dk> | 2025-04-02 14:49:22 +0200 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2025-04-02 14:49:22 +0200 |
commit | 84d6461dc76df4061a420735a42a3cf29623e81b (patch) | |
tree | 74412d641278ff10fbcc7131959a9f05860e9256 /Mussel/examples/voting | |
parent | c181fac0ae52a94a1951214250720668bfca558e (diff) |
add voting functions and example
Diffstat (limited to 'Mussel/examples/voting')
-rw-r--r-- | Mussel/examples/voting/voting.ino | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Mussel/examples/voting/voting.ino b/Mussel/examples/voting/voting.ino new file mode 100644 index 0000000..066180a --- /dev/null +++ b/Mussel/examples/voting/voting.ino @@ -0,0 +1,23 @@ +#include <Mussel.h> + +// instantiate for vote handling +Mussel mussel(10); + +void setup() { + Serial.begin(115200); + mussel.begin(); + + Serial.printf("\n\nDevice ready: %s\n", + mussel.desc().c_str()); +} + +void loop() { + // Inject sample data + mussel.push("A1", millis(), random(90)); + mussel.push("B2", millis(), random(90)); + mussel.push("C3", millis(), random(90)); + Serial.printf("gap:%d\n", + mussel.printStack()); + + delay(1000); +} |