Skip to content

Commit

Permalink
Deploying to gh-pages from @ dd368c1 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinOConnor committed Aug 13, 2023
1 parent 25ef789 commit 8335df5
Show file tree
Hide file tree
Showing 14 changed files with 28 additions and 9 deletions.
35 changes: 27 additions & 8 deletions RPi_microcontroller.html
Original file line number Diff line number Diff line change
Expand Up @@ -1588,27 +1588,46 @@ <h2 id="optional-hardware-pwm">Optional: Hardware PWM<a class="headerlink" href=
</code></pre></div>

<p>This example enables only PWM0 and routes it to gpio12. If both PWM
channels need to be enabled you can use <code>pwm-2chan</code>.</p>
channels need to be enabled you can use <code>pwm-2chan</code>:</p>
<div class="highlight"><pre><span></span><code># Enable pwmchip sysfs interface
dtoverlay=pwm-2chan,pin=12,func=4,pin2=13,func2=4
</code></pre></div>

<p>This example additionaly enables PWM1 and routes it to gpio13.</p>
<p>The overlay does not expose the pwm line on sysfs on boot and needs to
be exported by echo'ing the number of the pwm channel to
<code>/sys/class/pwm/pwmchip0/export</code>:</p>
<div class="highlight"><pre><span></span><code>echo 0 &gt; /sys/class/pwm/pwmchip0/export
<code>/sys/class/pwm/pwmchip0/export</code>. This will create device <code>/sys/class/pwm/pwmchip0/pwm0</code> in the
filesystem. The easiest way to do this is by adding this to
<code>/etc/rc.local</code> before the <code>exit 0</code> line:</p>
<div class="highlight"><pre><span></span><code># Enable pwmchip sysfs interface
echo 0 &gt; /sys/class/pwm/pwmchip0/export
</code></pre></div>

<p>When using both PWM channels, the number of the second channel needs to be echo'd as well:</p>
<div class="highlight"><pre><span></span><code># Enable pwmchip sysfs interface
echo 0 &gt; /sys/class/pwm/pwmchip0/export
echo 1 &gt; /sys/class/pwm/pwmchip0/export
</code></pre></div>

<p>This will create device <code>/sys/class/pwm/pwmchip0/pwm0</code> in the
filesystem. The easiest way to do this is by adding this to
<code>/etc/rc.local</code> before the <code>exit 0</code> line.</p>
<p>With the sysfs in place, you can now use either the pwm channel(s) by
adding the following piece of configuration to your <code>printer.cfg</code>:</p>
<div class="highlight"><pre><span></span><code>[output_pin caselight]
pin: host:pwmchip0/pwm0
pwm: True
hardware_pwm: True
cycle_time: 0.000001

[output_pin beeper]
pin: host:pwmchip0/pwm1
pwm: True
hardware_pwm: True
value: 0
shutdown_value: 0
cycle_time: 0.0005
</code></pre></div>

<p>This will add hardware pwm control to gpio12 on the Pi (because the
overlay was configured to route pwm0 to pin=12).</p>
<p>This will add hardware pwm control to gpio12 and gpio13 on the Pi (because the
overlay was configured to route pwm0 to pin=12 and pwm1 to pin=13).</p>
<p>PWM0 can be routed to gpio12 and gpio18, PWM1 can be routed to gpio13
and gpio19:</p>
<table>
Expand Down
Binary file modified _klipper3d/__pycache__/mkdocs_hooks.cpython-38.pyc
Binary file not shown.
Binary file modified fr/_klipper3d/__pycache__/mkdocs_hooks.cpython-38.pyc
Binary file not shown.
Binary file modified fr/sitemap.xml.gz
Binary file not shown.
Binary file modified hu/_klipper3d/__pycache__/mkdocs_hooks.cpython-38.pyc
Binary file not shown.
Binary file modified hu/sitemap.xml.gz
Binary file not shown.
Binary file modified it/_klipper3d/__pycache__/mkdocs_hooks.cpython-38.pyc
Binary file not shown.
Binary file modified it/sitemap.xml.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion search/search_index.json

Large diffs are not rendered by default.

Binary file modified sitemap.xml.gz
Binary file not shown.
Binary file modified zh-Hant/_klipper3d/__pycache__/mkdocs_hooks.cpython-38.pyc
Binary file not shown.
Binary file modified zh-Hant/sitemap.xml.gz
Binary file not shown.
Binary file modified zh/_klipper3d/__pycache__/mkdocs_hooks.cpython-38.pyc
Binary file not shown.
Binary file modified zh/sitemap.xml.gz
Binary file not shown.

0 comments on commit 8335df5

Please sign in to comment.