I'm using the PPMOut example and have added the updateTimings() method as updateTimingsFF() so I can switch back and forth. Of cource the new method was added to the PPMOut.h file. What I'm getting looks like no pause period is being set. I've looked on an Oscope. But when I throw some debug into the channel read section of loop() that must delay enough because then my FrSky receiver at least gets jittering data.
I also added this update I saw you mention in another thread:
Here's my TestPPMOut.ino example( using Adafruit Trinket Pro 5v ):
/* ---------------------------------------------------------------------------** This software is in the public domain, furnished "as is", without technical** support, and with no warranty, express or implied, as to its usefulness for** any purpose.**** ppmout_example.pde** Demonstrate Pulse Position Modulation Output functionality**** Author: Daniel van den Ouden** Project: ArduinoRCLib** Website: http://sourceforge.net/p/arduinorclib/** -------------------------------------------------------------------------*///NOTE:weirdformatingwhileposting,thislineisnotinthecode:include<PPMOut.h>#include<PPMOut.h>#include<Timer1.h>#defineDEBUG//enableFTDIportoutputfordebugging,disableserialwriteofJSIGdata#ifdefDEBUG#defineDEBUG_PRINT(x)Serial.print(x)#defineDEBUG_PRINTLN(x)Serial.println(x)#else#defineDEBUG_PRINT(x)#defineDEBUG_PRINTLN(x)#endif#defineCHANNELS2uint8_tg_pins[CHANNELS]={A0,A1};//,A1,A1};//,A1,A1,A1,A1};//Inputpinsuint16_tg_input[CHANNELS];//Inputbufferinmicrosecondsuint8_tg_work[PPMOUT_WORK_SIZE(CHANNELS)];//weneedtohaveaworkbufferforthePPMOutclass//PPMOutrequirestwobuffers://Inputbuffercontaininginputsamplesinmicroseconds//Workbufferof((channels+1)*2)elementsforinternalcalculationsandframebuffering//Thissetupremovesanylimitonthenumberofchannelsyouwant,andmakessurethelibrarydoesn'tusemore//memorythanitreallyneeds,sincetheclientcodesuppliesthebuffers.rc::PPMOutg_PPMOut(CHANNELS,g_input,g_work,CHANNELS);voidsetup(){//Initializetimer1,thisisrequiredforallfeaturesthatuseTimer1//(PPMIn/PPMOut/ServoIn/ServoOut)rc::Timer1::init();//use(true)fordebugging(ieslowseverythingdown;for(uint8_ti=0;i<CHANNELS;++i){//setupinputpinspinMode(g_pins[i],INPUT);//fillinputbuffer,convertrawvaluestomicrosecondsg_input[i]=1500;//DJLmap(analogRead(g_pins[i]),0,1024,1000,2000);}//initializePPMOutwithsomesettingsg_PPMOut.setPulseLength(448);//448);//pulselengthinmicrosecondsg_PPMOut.setPauseLength(10448);//10448);//lengthofpauseafterlastchannelinmicroseconds//note:thisisalsocalledtheendofframe,orstartofframe,andisusuallyaround10ms//startPPMOut,usepin9(pins9and10arepreferred)//g_PPMOut.start(9);g_PPMOut.start(9,true);//invertsthePPMsignal#ifdefDEBUGSerial.begin(19200);DEBUG_PRINTLN("Start DEBUG");#endif}voidloop(){//updatetheinputbufferfor(uint8_ti=0;i<CHANNELS;++i){//fillinputbuffer,convertrawvaluestomicrosecondsg_input[i]=map(analogRead(g_pins[i]),0,1024,1000,2000);if(i==0){DEBUG_PRINTLN("");DEBUG_PRINT("mapped AnalogRead=");DEBUG_PRINT(g_input[i]);}else{DEBUG_PRINT(":");DEBUG_PRINT(g_input[i]);}}//tellPPMOuttherearenewvaluesavailableintheinputbufferg_PPMOut.update();}
I'm using the PPMOut example and have added the updateTimings() method as updateTimingsFF() so I can switch back and forth. Of cource the new method was added to the PPMOut.h file. What I'm getting looks like no pause period is being set. I've looked on an Oscope. But when I throw some debug into the channel read section of loop() that must delay enough because then my FrSky receiver at least gets jittering data.
I also added this update I saw you mention in another thread:
Here's my TestPPMOut.ino example( using Adafruit Trinket Pro 5v ):
PPMOut.cpp added method:
Last edit: Doug LaRue 2015-11-04
I grabbed v.04 and it worked with the output inverted using the default timing in the example.