Quantcast
Channel: Reprap Forum - Firmware - Marlin
Viewing all articles
Browse latest Browse all 12089

Re: Analog vs Digital PIN assignment

$
0
0
Thank you for your input Dust,

These two definitions/pins are used very sparingly in the firmware. I had a look at your suggestion of possible inclusion and/or exclusion via #defines and could find no evidence of that being the case.

On looking at my second post I realize how absurd this seems. I define the TOGGLE_PIN to be an input and high pullup, and that is about it [in setup()]. The state of the pin is then later read and the output changed depending on the result.
That is:
    if (READ(TOGGLE_PIN)) -> do something
    else -> do something else
The FILWIDTH_PIN is used as default in the Marlin firmware, as when the #define FILAMENT_WIDTH_SENSOR is uncommented in the Configuration.h. The only change I made is to use a different AUX pin, 3 instead of 5.

The LCD screen is updated every second. The width of the filament is being displayed and updated every second, and this works great. I also display another variable (which I made 2.0 or 5.0 for testing purposes)
to display the state of the toggle switch. When the switch is toggled the display is updated accordingly, either 2.0, or 5.0, constantly....

The two physical input pins are on different places on the RAMPS board -> and this is the part that really confuses me. How does the FW know which physical pin to use?

Viewing all articles
Browse latest Browse all 12089

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>