0
$\begingroup$

Can anyone tell me if it is possible to send data through the analogue pins of the Ardupilot to the analog pins of the Arduino? For example, I would like to trigger a button on a channel from my radio control and Ardupilot should send a specific number to the Arduino. Would anyone have any idea how I can do this? Thank you in advance.

$\endgroup$
1
  • $\begingroup$ You could use the servo pinouts for the camera/ additional sensor for this. You would need to map the pulse corresponding to your "trigger" on the transmitter to a specific value on the Arduino. This is pretty simple, come to think of it- you are sending a servo signal from the Ardupilot and receiving it on the Arduino. $\endgroup$
    – sg_robs
    Commented Nov 20, 2016 at 7:48

2 Answers 2

1
$\begingroup$

The best way to achieve this would be with RC channel pass through, you can configure any channel from 7-14 for RC passthrough (technically you can configure lower channels for this but this can cause weird things to happen as they might be sharing your pitch/roll/yaw/throttle/mode setting) You can then read in the servo value on the arduino with the pulseIn function, Ideally the servo output should be very accurate but for robustness I would have 10 µs ranges, allowing you to have over 100 unique outputs. As a bonus you can use the Do_Set_Servo command using pre programmed missions to activate your arduino at specific waypoints.

$\endgroup$
0
$\begingroup$

Specific number? no. there will be some inaccuracy.

Also note that your servo output is a period of time at high voltage, then a long gap at ground. So if you just use analogRead then you will only ever get high or low value (seemingly at randomly as your Arduino and ardupilot drift in and out of phase). You would have to (unless there already exists a library) time the ms the channel stays high for. Or you could try and smooth this signal with a capacitor and use analogRead as normal (very inaccurate BTW, but could easily determine an on/off signal from a transmitter).

Alternatively, use I2C, this will allow you to send precise data between your 2 devices. But you will have to find out how to instruct your Ardupilot on what to send over the I2C bus.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.