diff options
Diffstat (limited to 'Mussel/examples/button_states/button_states.ino')
-rw-r--r-- | Mussel/examples/button_states/button_states.ino | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Mussel/examples/button_states/button_states.ino b/Mussel/examples/button_states/button_states.ino new file mode 100644 index 0000000..1d91b41 --- /dev/null +++ b/Mussel/examples/button_states/button_states.ino @@ -0,0 +1,20 @@ +#include <Mussel.h> + +// instantiate with attitude #5, +// and pin 9 connected to a button +Mussel mussel(5, 9); + +void setup() { + Serial.begin(115200); + mussel.begin(); + + Serial.printf("\n\nDevice ready: %s\n", + mussel.desc().c_str()); +} + +void loop() { + Serial.printf("gap:%d\n", + mussel.read()); + + delay(1000); +} |