Skip to content

confusing pin mode setup #1

Open
@dneise

Description

@dneise

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions