<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[I would like to send a PPM with M5 stack Fire]]></title><description><![CDATA[<p dir="auto">HI,<br />
after to consult many web page I don't find a solution<br />
I would like to dialog with VESC to control the speed motor via PPN signal (NO PWM)<br />
Somebody have an idea ? or know how to do this ?<br />
thx<br />
Alain</p>
]]></description><link>https://community.m5stack.com/topic/3304/i-would-like-to-send-a-ppm-with-m5-stack-fire</link><generator>RSS for Node</generator><lastBuildDate>Sun, 14 Jun 2026 17:15:25 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/3304.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 23 May 2021 15:38:19 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to I would like to send a PPM with M5 stack Fire on Fri, 04 Jun 2021 11:42:51 GMT]]></title><description><![CDATA[<p dir="auto">@amn<br />
HI found this code: (how to adapt with potentiometre for the lenght of pulse , ?)</p>
<p dir="auto">//////////////////////CONFIGURATION///////////////////////////////<br />
#define chanel_number 1  //set the number of chanels<br />
#define default_servo_value 1500  //set the default servo value<br />
#define PPM_FrLen 22500  //set the PPM frame length in microseconds (1ms = 1000µs)<br />
#define PPM_PulseLen 300  //set the pulse length<br />
#define onState 1  //set polarity: 1 is positive, 0 is negative<br />
#define sigPin 36  //set 10 PPM signal pin on the arduino</p>
<p dir="auto">/<em>this array holds the servo values for the ppm signal<br />
change theese values in your code (usually servo values are between 1000 and 2000)</em>/<br />
int ppm[chanel_number];</p>
<p dir="auto">void setup(){<br />
// Initialize the M5Stack object<br />
M5.begin();<br />
/*<br />
Power chip connected to gpio21, gpio22, I2C device<br />
Set battery charging voltage and current<br />
If used battery, please call this function in your project<br />
*/<br />
M5.Power.begin();</p>
<p dir="auto">M5.Lcd.fillScreen(BLACK);<br />
M5.Lcd.setTextColor(GREEN , BLACK);<br />
M5.Lcd.setTextSize(2);</p>
<p dir="auto">//initiallize default ppm values<br />
for(int i=0; i&lt;chanel_number; i++){<br />
ppm[i]= default_servo_value;<br />
}</p>
<p dir="auto">pinMode(sigPin, OUTPUT);<br />
digitalWrite(sigPin, !onState);  //set the PPM signal pin to the default state (off)<br />
}</p>
<p dir="auto">void loop(){<br />
//put main code here<br />
ppmWrite();</p>
<p dir="auto">}</p>
<p dir="auto">void ppmWrite(){  //generate PPM signal<br />
static unsigned long lastFrLen;<br />
static unsigned long lastServo;<br />
static unsigned long lastPulse;<br />
static boolean PPM_run;<br />
static boolean pulse;<br />
static boolean pulseStart = true;<br />
static byte counter;<br />
static byte part = true;</p>
<p dir="auto">if(micros() - lastFrLen &gt;= PPM_FrLen){  //start PPM signal after PPM_FrLen has passed<br />
lastFrLen = micros();<br />
PPM_run = true;<br />
}</p>
<p dir="auto">if(counter &gt;= chanel_number){<br />
PPM_run = false;<br />
counter = 0;<br />
pulse = true;  //put out the last pulse<br />
}</p>
<p dir="auto">if(PPM_run){<br />
if (part){  //put out the pulse<br />
pulse = true;<br />
part = false;<br />
lastServo = micros();<br />
}<br />
else{  //wait till servo signal time (values from the ppm array) has passed<br />
if(micros() - lastServo &gt;= ppm[counter]){<br />
counter++;  //do the next channel<br />
part = true;<br />
}<br />
}<br />
}</p>
<p dir="auto">if(pulse){<br />
if(pulseStart == true){  //start the pulse<br />
digitalWrite(sigPin, onState);<br />
pulseStart = false;<br />
lastPulse = micros();<br />
}<br />
else{  //will wait till PPM_PulseLen has passed and finish the pulse<br />
if(micros() - lastPulse &gt;= PPM_PulseLen){<br />
digitalWrite(sigPin, !onState);<br />
pulse = false;<br />
pulseStart = true;<br />
}<br />
}<br />
}<br />
}</p>
]]></description><link>https://community.m5stack.com/post/13995</link><guid isPermaLink="true">https://community.m5stack.com/post/13995</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Fri, 04 Jun 2021 11:42:51 GMT</pubDate></item><item><title><![CDATA[Reply to I would like to send a PPM with M5 stack Fire on Thu, 03 Jun 2021 12:59:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/m5stack" aria-label="Profile: m5stack">@<bdi>m5stack</bdi></a> said in <a href="/post/13982">I would like to send a PPM with M5 stack Fire</a>:<br />
read on the web the timer is different between Arduino and ESP32<br />
could be nice to find sample of code.<br />
other this I'll continue my investigation<br />
thx</p>
]]></description><link>https://community.m5stack.com/post/13987</link><guid isPermaLink="true">https://community.m5stack.com/post/13987</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Thu, 03 Jun 2021 12:59:22 GMT</pubDate></item><item><title><![CDATA[Reply to I would like to send a PPM with M5 stack Fire on Wed, 02 Jun 2021 11:20:24 GMT]]></title><description><![CDATA[<p dir="auto">@amn said in <a href="/post/13976">I would like to send a PPM with M5 stack Fire</a>:</p>
<blockquote>
<p dir="auto">'TCCR1A' was not declared in this scope</p>
</blockquote>
<p dir="auto"><code>'TCCR1A' was not declared in this scope</code></p>
<p dir="auto">that  looks like is a grammar error..... you just need define the function before you use it,</p>
]]></description><link>https://community.m5stack.com/post/13982</link><guid isPermaLink="true">https://community.m5stack.com/post/13982</guid><dc:creator><![CDATA[m5stack]]></dc:creator><pubDate>Wed, 02 Jun 2021 11:20:24 GMT</pubDate></item><item><title><![CDATA[Reply to I would like to send a PPM with M5 stack Fire on Tue, 01 Jun 2021 16:24:32 GMT]]></title><description><![CDATA[<p dir="auto">Hi<br />
already test these program, no compatble with ESP32 or M5 stack seem a problem of timer.<br />
turn on the loop.</p>
<p dir="auto">type of error:<br />
error: 'TCCR1A' was not declared in this scope</p>
]]></description><link>https://community.m5stack.com/post/13976</link><guid isPermaLink="true">https://community.m5stack.com/post/13976</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Tue, 01 Jun 2021 16:24:32 GMT</pubDate></item><item><title><![CDATA[Reply to I would like to send a PPM with M5 stack Fire on Tue, 01 Jun 2021 02:09:07 GMT]]></title><description><![CDATA[<p dir="auto">maybe you could try their example:</p>
<p dir="auto"><a href="https://github.com/kolod/Arduino-PPM-Generator" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/kolod/Arduino-PPM-Generator</a></p>
<p dir="auto"><a href="https://github.com/smilexth/Generate-PPM-Signal/blob/master/Generate-PPM-Signal.ino" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/smilexth/Generate-PPM-Signal/blob/master/Generate-PPM-Signal.ino</a></p>
]]></description><link>https://community.m5stack.com/post/13971</link><guid isPermaLink="true">https://community.m5stack.com/post/13971</guid><dc:creator><![CDATA[m5stack]]></dc:creator><pubDate>Tue, 01 Jun 2021 02:09:07 GMT</pubDate></item><item><title><![CDATA[Reply to I would like to send a PPM with M5 stack Fire on Mon, 31 May 2021 08:12:24 GMT]]></title><description><![CDATA[<p dir="auto">Hi<br />
no find yet a correct solution<br />
somebody have exemple ?<br />
other this need for me to return to my arduino board.<br />
Thx</p>
]]></description><link>https://community.m5stack.com/post/13960</link><guid isPermaLink="true">https://community.m5stack.com/post/13960</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Mon, 31 May 2021 08:12:24 GMT</pubDate></item><item><title><![CDATA[Reply to I would like to send a PPM with M5 stack Fire on Sat, 29 May 2021 13:40:11 GMT]]></title><description><![CDATA[<p dir="auto">thx, found this <a href="https://github.com/schinken/PPMEncoder" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/schinken/PPMEncoder</a><br />
try later</p>
]]></description><link>https://community.m5stack.com/post/13945</link><guid isPermaLink="true">https://community.m5stack.com/post/13945</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Sat, 29 May 2021 13:40:11 GMT</pubDate></item><item><title><![CDATA[Reply to I would like to send a PPM with M5 stack Fire on Wed, 26 May 2021 06:05:03 GMT]]></title><description><![CDATA[<p dir="auto">you could try search some keywords <code>esp32</code> <code>ppm</code> `Arduino in Github.  maybe some lib could do that.</p>
<p dir="auto"><a href="https://github.com/search?q=arduino+ppm" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/search?q=arduino+ppm</a></p>
]]></description><link>https://community.m5stack.com/post/13881</link><guid isPermaLink="true">https://community.m5stack.com/post/13881</guid><dc:creator><![CDATA[m5stack]]></dc:creator><pubDate>Wed, 26 May 2021 06:05:03 GMT</pubDate></item></channel></rss>