Using I/O Ports as an Input

Hello,
does anyone know if the I/O ports can be used as input ports for a PWM signal?
I have the Pixhawk 6x…
The docu specifies just the I/O ports as an output
Thanks in advance!

1 Like

GPIO

1 Like

Thanks, I also read this docu but it is only written for output

There are some PWM input sensor types used on a GPIO Input pin. Fuel flow and level. The Battery Monitor function can be used to scale it.
Flow and Level Sensors
What type of PWM input do you have?

1 Like

Thanks!
I also tried this method but I can’t display any values in Mission Planner.
I followed the instructions but it seems the GPIO pins on the Pixhawk 6x are just output pins.
This is how I set the parameter in MP:

SERVO2_FUNCTION: -1
RPM1_TYPE: 2 = GPIO
RPM1_PIN: 51 = AUX2

rpm1 should show me the change in sensor value (see attached image)

Try setting up a button? Buttons — Copter documentation
I don’t know if there’s an easy way to show the value with it, I’ve only used it as an input to trigger an auxiliary function.

1 Like

I suppose like all Flight Controllers with an IOMCU you have to use the “Aux” pins for GPIO. Servo02 would not be one of those.

1 Like

but how to configure it as an input?

It will be set as an input if the TYPE chosen is an Input. Forget the idea that GPIO can’t be configured as an Input, it can be.

RPM? Your previous post said PWM.
I suppose you have read this page RPM measurement.

1 Like

Okay it’s getting closer to a solution…
So I think the FMU PWM Pin 1 (58) is the right pin but I’m not sure how to configure the params in Mission Planner
The output of my RPM sensor is a PWM signal

Then it’s not a standard RPM input as Ardupilot knows it. I think you will have to use the workaround as I suggested or perhaps an outboard board (arduino, etc).

Check out this excellent Blog Post by @Yuri_Rage
Arduino+LUA

1 Like