feat: V1 fonctionnel OK #8

Merged
Clement merged 8 commits from feat/main-algo-2 into master 2023-12-03 11:24:38 +00:00
Showing only changes of commit 213456b6ab - Show all commits

View File

@ -45,6 +45,9 @@ SwitchableEncodeur* SwitchableEncodeur::getInstance() {
bool SwitchableEncodeur::update() {
bool sortie = false;
long newPosition = this->read()/4;
if(newPosition <= 0){
newPosition = 0;
}
if (newPosition != this->oldPosition || this->menu != this->oldMenu) {
this->oldMenu = this->menu;
this->oldPosition = newPosition;
@ -62,4 +65,5 @@ int SwitchableEncodeur::getValue() {
void SwitchableEncodeur::resetValue() {
this->oldPosition = 0;
this->readAndReset();
}