Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 2 of 2

Thread: Editing PPM Library in Teensyduino

  1. #1
    Junior Member
    Join Date
    Feb 2021
    Location
    Utah, USA
    Posts
    2

    Editing PPM Library in Teensyduino

    Hi All,

    Summary of current problem:
    I am trying to send a PPM signal from a Teensy 4.0 to a Pixhawk4 flight controller using the PulsePosition Library included in the teensyduino install. I am outputting a PPM signal (checked with an arduino mega), but the pixhawk does not recognize it.

    What I've found so far:
    This may be due to line ~66 in the PulsePosition.cpp
    Code:
    #define TX_PULSE_ WIDTH 100
    (I want to change it to 300). [https://discuss.ardupilot.org/t/solv...xhawk/37930/7]

    Issue:
    I am not sure if I am editing the PulsePosition.cpp that teensyduino is actually running. I downloaded just the PulsePosition library from github [https://github.com/PaulStoffregen/PulsePosition] separately and edited those files, but I believe teensyduino already had the library downloaded/ installed so it may still be running those original files.

    Question:
    How do I find/edit the libraries inherent to the teensyduino installation? (just on my personal PC - I am running windows and have the teensyduino application downloaded in 'Downloads')

    Alternatively:
    Is there something else that may be going wrong or any other suggestions that could help with the initial problem? This is difficult to reproduce without a pixhawk but I appreciate the help!

    Thank you so much for your help!
    *Note- first time posting on this forum so I welcome any advice, suggestions, links to other threads I haven't found yet, or even 'don't do it like that ever' *

    Code: (disclaimer - half of this is also reading in a PPM signal [working perfectly] so that part can be ignored)
    Code:
    #include <PulsePosition.h>
    
    PulsePositionInput DLRXinput(FALLING);
    PulsePositionOutput PXHKoutput(FALLING);
    
    void setup() {
      DLRXinput.begin(6); //signal from DL must be connected to pin 6
      PXHKoutput.begin(10); //signal to Pxhwk must be coming from pin 10 
      Serial.print("Setup Complete\n");
    }
    
    void loop() {
      // read in the PWM channels from the DL
      int chAil = DLRXinput.read(1);
      int chElev = DLRXinput.read(2);
      int chThr = DLRXinput.read(3);
      int chRudd = DLRXinput.read(4);
    
      // print out PWM signals to verify working correctly
      Serial.print(chAil);Serial.print("\t");
      Serial.print(chElev);Serial.print("\t");
      Serial.print(chThr);Serial.print("\t");
      Serial.print(chRudd);Serial.print("\n");
    
      // send channels directly through to the pixhawk 
      //PXHKoutput.write(1,chAil);
      //PXHKoutput.write(2,chElev);
      //PXHKoutput.write(3,chThr);
      //PXHKoutput.write(4,chRudd);
    
      // test purely the PPM output (not using read in signals)
      PXHKoutput.write(1,1200);
    
      delay(100);
    
      PXHKoutput.write(1,1700);
    
    }
    Picture of wiring setup (both receiver & pixhawk connected w/ ground, voltage, and signal wires):
    Click image for larger version. 

Name:	Setup.PNG 
Views:	39 
Size:	471.8 KB 
ID:	23743
    Last edited by snow121; 02-19-2021 at 04:29 PM. Reason: included picture of setup

  2. #2
    Junior Member
    Join Date
    Feb 2021
    Location
    Utah, USA
    Posts
    2
    Update: followed directions in this thread (https://forum.pjrc.com/threads/52888...-Audio-Library) and verified that it is using the correct library (ie: I did successfully change that parameter). So now I'm really not sure what the issue is...

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •