Skip to content
Snippets Groups Projects
RotaryEncoderBehaviours.h 761 B
Newer Older
#ifndef ROTARYENCODER_BEHAVIOUR_h
#define ROTARYENCODER_BEHAVIOUR_h
#include "Arduino.h"
#include "Behaviours.h"
#include <WallVis.h>

class RotaryEncoderUpdated : public Behaviour {
  /*
   * Class that defines a behaviour that publishes a
   * ButtonPressed message to the input topic of the
   * MQQT broker
   */
   WallVis* _node;

public:
  RotaryEncoderUpdated(WallVis* node, String name = "RotaryEncoderUpdated") :
    Behaviour(name), _node(node){ }

  char* args() {return "<String rotaryEncoderId> <int position>"; };

  String start(String args) {
    //This is where you do your stuff for a simple behaviour
    _node->input_publish(_name + " " + args);
    return "PotentiometerUpdated behaviour " + _name + " with (" + args + ")";
  }
};

#endif