JAR4x4
Posts: 4
Joined: Fri Oct 28, 2016 6:27 pm

Use GPIO connected buttons to issue commands

Fri Oct 28, 2016 6:43 pm

Hello!

I´m new here and fairly new to the RPi and programming in general, but I´m learning =)

I´m currently playing around with a drone project. The on board controller in the drone is actually based on the RPi also - http://www.emlid.com The drone is up and running and I control it with a RC transmitter and/or my laptop.

Now I´m constructing my own ground control station based on two RPi´s, one for videolink and one for telemetry.

On the telemetry side I´m running a program called MavProxy https://github.com/ArduPilot/MAVProxy. This runs fine on my RPi 3 and I get connected to the drone. MavProxy is written in Python.

My problem:

I want to use buttons connected to the RPi GPIO to issue terminal commands to the MavProxy software instead of using a keyboard to type the commands in the terminal. I´ve got the buttons hooked up and I have written a basic "Button Pushed" program in Python, but I have no clue on how i can get the GPIO input to issue commands in the MavProxy terminal window.

Can anyone help me in the right direction?

Best regards
Alex

Return to “Python”