You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is no documentation about the pinout, i.e. which arduino pin is connected to what part of the motor controller board. So we have to deduce this from the code, which we know is working.
For this project we need 2 analog inputs to measure each motors current consumptions and 2 analog inputs to measure each hall sensors position. So 4 inputs make total sense.
However here in function ReadCurrent() one can see, that in fact the analog inputs A4 and A5 are used to measure the motors current consumption. they are used, without ever being setup as inputs. The fact that this works is pure luck. Maybe the arduino std-lib sets them up as inputs, when one calls "analogRead()" on them, I don't know.
this is maximum confusing and must be changed.
The text was updated successfully, but these errors were encountered:
There is no documentation about the pinout, i.e. which arduino pin is connected to what part of the motor controller board. So we have to deduce this from the code, which we know is working.
However, this code is confusing in parts, e.g.:
In the part, where the pin modes are setup as "INPUT" or "OUTPUT", this line
https://github.com/fact-project/ShutterController/blob/master/src/ShutterController.cpp#L261
implies the analog pins A0, A1, A2 and A3 are used as inputs.
For this project we need 2 analog inputs to measure each motors current consumptions and 2 analog inputs to measure each hall sensors position. So 4 inputs make total sense.
However here in function ReadCurrent() one can see, that in fact the analog inputs A4 and A5 are used to measure the motors current consumption. they are used, without ever being setup as inputs. The fact that this works is pure luck. Maybe the arduino std-lib sets them up as inputs, when one calls "analogRead()" on them, I don't know.
this is maximum confusing and must be changed.
The text was updated successfully, but these errors were encountered: