diff --git a/lib/SwitchableEncodeur/include/SwitchableEncodeur.h b/lib/SwitchableEncodeur/include/SwitchableEncodeur.h index bfa57f5..a0006a7 100644 --- a/lib/SwitchableEncodeur/include/SwitchableEncodeur.h +++ b/lib/SwitchableEncodeur/include/SwitchableEncodeur.h @@ -39,6 +39,13 @@ public: */ int getValue(); + /** + * @brief set the encodeur value + * + * @param val the new encodeur value + */ + void setValue(int val); + /** * @brief update the encodeur value * diff --git a/lib/SwitchableEncodeur/src/SwitchableEncodeur.cpp b/lib/SwitchableEncodeur/src/SwitchableEncodeur.cpp index af456f9..f0200e4 100644 --- a/lib/SwitchableEncodeur/src/SwitchableEncodeur.cpp +++ b/lib/SwitchableEncodeur/src/SwitchableEncodeur.cpp @@ -67,3 +67,7 @@ void SwitchableEncodeur::resetValue() { this->oldPosition = 0; this->readAndReset(); } + +void SwitchableEncodeur::setValue(int val){ + this->write(val*4); +}