FluidNC Setting Up I O Pins - Longus/FluidNC GitHub Wiki

Configuring GPIO

You must assign a pin number and attributes to each pin used in your configuration. FluidNC will know the basic input vs. output requirement based the the feature it is assigned to. For example, it knows that GPIO assigned to a limit switch will always be an input. There are a few attributes for each type of pin. Each attribute has a default state, so they are all optional. Each attribute is preceded with a colon. They can be used in any order. They are not case sensitive. For consistency and ease of reading, we recommend using lowercase.

Pin Numbers

There are currently two types of pins that can be used, gpio and i2so. You specify a pin with the type, followed by a period, followed by the pin number. For example, gpio.14 or i2so.24

  • gpio These are native ESP32 pins. There are quite flexible and can be used for most features.
  • i2so These are on external I2S chips. They are output only and cannot be used for advanced things like PWM. They are only available on controller hardware that implements them, like the 6 Pack.

Input Pin Attributes

  • Active state Each input feature has an active state. For example, the active state of a switch would be when the switch is pushed. Depending on your switch type and wiring the switch may be connecting a low voltage (ground) or a logic high voltage to the CPU when the switch is pushed. You specify this in your configuration with the high or low attribute. Examples: gpio:14:high or gpio.14:low It will use the default of high if it is not specified. If your switch is reporting backwards from what you want, flip the :high to :low or the other way around.
  • Pulling resistor You can add a pull-up or pull-down resistor to input pins. This is done with the pu (pull-up) or pd (pull-down) attribute. Examples: gpio.14:high:pd or gpio.14:low:pu. The default is no pulling resistor. The pin will be floating unless you have an external circuit that pulls it one way or the other.

examples

  limit_all_pin: gpio.16:low:pu

Output Pin Attributes

  • Active state Each output feature has an active state. This usually means the feature is on. Depending on your circuitry, a low or high output signal will turn on the feature. You specify this in your configuration with the high or low attribute. Examples: gpio:14:high or gpio.14:low It will is the default of high if it is not specified.

If your feature is working backwards from what you want, like the direction pin for a motor, flip the hi to low, or the other way around.

examples

  direction_pin: gpio.15
 
  coolant:
    flood_pin: gpio.25:low