Raspberry PWM LED Control: Difference between revisions

From BITPlan Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
* https://electronicshobbyists.com/raspberry-pi-pwm-tutorial-control-brightness-of-led-and-servo-motor/
* https://electronicshobbyists.com/raspberry-pi-pwm-tutorial-control-brightness-of-led-and-servo-motor/
We'll use GPIO Pin 24 as in the default configuration of rc-dukes.
We'll use GPIO 24/ Pin 18 to drive the LED as in the default configuration of rc-dukes.


[[File:Raspberry-pi-pinout.png|400px]]


[[File:PILEDPWM-2019-06-21.png|400px]]
[[File:PILEDPWM-2019-06-21.png|400px]]
We are going to use the Servoblaster software
see {{Link|target=Self_Driving_RC_Car#Servo Interface - Servoblaster}}
<source lang='bash'>
cat /run/servoblaster.status
p1pins=7,11,12,13,15,16,18,22
p5pins=
Servo mapping:
    0 on P1-7          GPIO-4
    1 on P1-11          GPIO-17
    2 on P1-12          GPIO-18
    3 on P1-13          GPIO-27
    4 on P1-15          GPIO-22
    5 on P1-16          GPIO-23
    6 on P1-18          GPIO-24
    7 on P1-22          GPIO-25
</source>
GPIO 24 has Servoblaster Id 6 so
<source lang='bash'>
echo 6=120 > /dev/servoblaster
</source>
will set the LED to half bright
[[Category:Raspberry]]
[[Category:Raspberry]]

Latest revision as of 20:39, 22 June 2019

We'll use GPIO 24/ Pin 18 to drive the LED as in the default configuration of rc-dukes.

Raspberry-pi-pinout.png

PILEDPWM-2019-06-21.png

We are going to use the Servoblaster software see Self_Driving_RC_Car#Servo Interface - Servoblaster

cat /run/servoblaster.status 
p1pins=7,11,12,13,15,16,18,22
p5pins=

Servo mapping:
     0 on P1-7           GPIO-4
     1 on P1-11          GPIO-17
     2 on P1-12          GPIO-18
     3 on P1-13          GPIO-27
     4 on P1-15          GPIO-22
     5 on P1-16          GPIO-23
     6 on P1-18          GPIO-24
     7 on P1-22          GPIO-25

GPIO 24 has Servoblaster Id 6 so

echo 6=120 > /dev/servoblaster

will set the LED to half bright