AmboVent-1690-108 / AmboVent

AmboVent 1690.108
The Unlicense
206 stars 69 forks source link

RST does something random #9

Closed innermatrix closed 4 years ago

innermatrix commented 4 years ago

This line should be 1 - digitalRead(PIN_RST)

https://github.com/AmboVent/AmboVent/blob/e889eb9853d8ce3cfa903381849227c7397c351b/.Software/Arduino%20Code/ventilation_machine/ventilation_machine.ino#L502

salam17 commented 4 years ago

RST is initialized to zero so the first digitalRead(RST) call is equivalent to digitalRead(pin_POT). On the next call. If the digitalRead returned zero, RST becomes 1 and the next read will be from pin_CUR, not an expected result. RST is used to set the sign of wanted_cal_PWM so reading the rough position of pin_POT makes sense ( 0 for a position close to the minimum). Should line 502 be: RST = (1-digitalRead (pin_POT)); ?

nimrod46 commented 4 years ago

I fixed this line but keep in mind that this button is not currently in use, it's used only in calibration