Hi there,
I thought it would be easy to get information through GPIO AUX ports !
I’m currently using Mission Planner 1.3.81 build 1.3.87, ArduPlane V4.4.0 Cube Orange; SCR_ENABLE = 1
In that version BRD_PWM_COUNT doesn’t exist anymore.
My Code tries to affect Pin 2 and 3, and to read it, but unfortunatly nothing happens when I put it to HIGH (3-5V). On the screen I have always “Blue Green = 10” with or without avtivating the pins. (Im using rangefinder on 5-6 and it’s working nicely )
Blockquote
gpio:pinMode(51,0) – AUX 2
gpio:pinMode(52,0) – set AUX 3 to input, gpio:pinMode(51,1) would be output
local Blue = false
local Green = false
function update()
Green = gpio:read(51)
Blue = gpio:read(52)
if not Blue and not Green then
gcs:send_text(0, "Blue Green = 00 OK")
elseif Blue and not Green then
gcs:send_text(0, "Blue Green = 10")
elseif not Blue and Green then
gcs:send_text(0, "Blue Green = 01")
elseif Blue and Green then
gcs:send_text(0, "Blue Green = 11 STOP")
else
gcs:send_text(0, "Aucune correspondace")
end
Hi Yuri, Thanks a lot ! Yes your code is working : the states are changing one by one !
In my case I had some difficulties linked to the fact that I discovered that if you dont force the Signal Pin to “LOW” by linking to “GND”, the state will be “HIGH”. If you leave it alone it’s HIGH… initially I thought that if no Signal it would be LOW but NO.
In my case to be abble to read the signal sent to the GPIO I have set
@Yuri_Rage I was planning to use 51 & 52 (see picture)
If I wanted to generate a pulse when RC11 is high for example, from one of the Main out or Aux pins. The next pulse will only happen when the user switches RC11 to low first and then high again. Do I still need to configure it as Relay style? Do I need to map the RC11_OPTION,28? or SERVO7_FUNCTION,-1 is sufficient.
okay, I managed to get it working. RCx_OPTION can only map to one selection. That is 28 or 301. Since I need to detect the RC11 edge trigger, low to high to generate an update, TOGGLE_DELAY to create the pulse, I map it to 301.
then I use the relay:enabled and the relay:toggle to do the jobs. I cannot use rc:run_aux_function(28, flip_flop).