This commit is contained in:
2025-07-05 17:27:32 -04:00
parent 5c535c4968
commit fa3906b087
10 changed files with 19 additions and 19 deletions

View File

@@ -24,8 +24,8 @@ When used with communication protocols like ESP-NOW, this struct is **encoded**
**transmitted** at regular intervals or in response to user input, and finally
**decoded** on the receiving end to control hardware.
Struct Walkthrough
------------------
Data Payload
------------
*x_axis* and *y_axis* fields capture analog input from a joystick, determining direction and speed.
*nav_bttn* represents a joystick push-button.
@@ -35,7 +35,7 @@ Struct Walkthrough
*motor1_rpm_pwm* to *motor4_rpm_pwm* provide individual PWM signals to four DC motors.
This enables fine-grained speed control, supports differential drive configurations, and even allows for maneuvering in multi-directional platforms like omni-wheel robots.
Why Use __attribute((packed))?
Why use __attribute((packed))?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ESP-NOW uses fixed-size data packets (up to 250 bytes). The *__attribute__((packed))* removes compiler-added padding for precise byte alignment.

View File

@@ -54,15 +54,15 @@ Its intended to be sent from a transmitting device (like a remote control or
<p>When used with communication protocols like ESP-NOW, this struct is <strong>encoded</strong> into a byte stream, then
<strong>transmitted</strong> at regular intervals or in response to user input, and finally
<strong>decoded</strong> on the receiving end to control hardware.</p>
<section id="struct-walkthrough">
<h2>Struct Walkthrough<a class="headerlink" href="#struct-walkthrough" title="Link to this heading"></a></h2>
<section id="data-payload">
<h2>Data Payload<a class="headerlink" href="#data-payload" title="Link to this heading"></a></h2>
<p><em>x_axis</em> and <em>y_axis</em> fields capture analog input from a joystick, determining direction and speed.
<em>nav_bttn</em> represents a joystick push-button.</p>
<p><em>led</em> allows the transmitter to toggle an onboard LED and is used for status indication (e.g. pairing, battery warning, etc).</p>
<p><em>motor1_rpm_pwm</em> to <em>motor4_rpm_pwm</em> provide individual PWM signals to four DC motors.
This enables fine-grained speed control, supports differential drive configurations, and even allows for maneuvering in multi-directional platforms like omni-wheel robots.</p>
<section id="why-use-attribute-packed">
<h3>Why Use __attribute((packed))?<a class="headerlink" href="#why-use-attribute-packed" title="Link to this heading"></a></h3>
<h3>Why use __attribute((packed))?<a class="headerlink" href="#why-use-attribute-packed" title="Link to this heading"></a></h3>
<p>ESP-NOW uses fixed-size data packets (up to 250 bytes). The <em>__attribute__((packed))</em> removes compiler-added padding for precise byte alignment.</p>
<p>As <em>packed</em> attribute tells the compiler not to add any padding between fields in memory, this makes the struct:</p>
<blockquote>
@@ -107,7 +107,7 @@ This enables fine-grained speed control, supports differential drive configurati
<li class="toctree-l1"><a class="reference internal" href="intro.html">INTRODUCTION</a></li>
<li class="toctree-l1"><a class="reference internal" href="overview.html">HOW DOES IT WORK?</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">DATA STRUCT</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#struct-walkthrough">Struct Walkthrough</a></li>
<li class="toctree-l2"><a class="reference internal" href="#data-payload">Data Payload</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="transmitter.html">TRANSMITTER</a></li>

View File

@@ -45,7 +45,7 @@
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="data.html">DATA STRUCT</a><ul>
<li class="toctree-l2"><a class="reference internal" href="data.html#struct-walkthrough">Struct Walkthrough</a></li>
<li class="toctree-l2"><a class="reference internal" href="data.html#data-payload">Data Payload</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="transmitter.html">TRANSMITTER</a><ul>

File diff suppressed because one or more lines are too long

View File

@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
config: c7af3d195780d92aa8671f9064b2c06a
config: d34a004e496198515034b25931fe275c
tags: 62a1e7829a13fc7881b6498c52484ec0

View File

@@ -93,8 +93,8 @@
</a>
<ul>
<li class="toctree-l2">
<a class="reference internal" href="#struct-walkthrough">
Struct Walkthrough
<a class="reference internal" href="#data-payload">
Data Payload
</a>
</li>
</ul>
@@ -650,10 +650,10 @@ It&rsquo;s intended to be sent from a transmitting device (like a remote control
</strong>
on the receiving end to control hardware.
</p>
<section id="struct-walkthrough">
<section id="data-payload">
<h3>
Struct Walkthrough
<a class="headerlink" href="#struct-walkthrough" title="Link to this heading">
Data Payload
<a class="headerlink" href="#data-payload" title="Link to this heading">
&para;
</a>
</h3>
@@ -690,7 +690,7 @@ This enables fine-grained speed control, supports differential drive configurati
</p>
<section id="why-use-attribute-packed">
<h4>
Why Use __attribute((packed))?
Why use __attribute((packed))?
<a class="headerlink" href="#why-use-attribute-packed" title="Link to this heading">
&para;
</a>

View File

@@ -24,8 +24,8 @@ When used with communication protocols like ESP-NOW, this struct is **encoded**
**transmitted** at regular intervals or in response to user input, and finally
**decoded** on the receiving end to control hardware.
Struct Walkthrough
------------------
Data Payload
------------
*x_axis* and *y_axis* fields capture analog input from a joystick, determining direction and speed.
*nav_bttn* represents a joystick push-button.
@@ -35,7 +35,7 @@ Struct Walkthrough
*motor1_rpm_pwm* to *motor4_rpm_pwm* provide individual PWM signals to four DC motors.
This enables fine-grained speed control, supports differential drive configurations, and even allows for maneuvering in multi-directional platforms like omni-wheel robots.
Why Use __attribute((packed))?
Why use __attribute((packed))?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ESP-NOW uses fixed-size data packets (up to 250 bytes). The *__attribute__((packed))* removes compiler-added padding for precise byte alignment.