User Manual

30
For C language users:
Step 2: Change directory
cd /home/pi/Sunfounder_SuperKit_C_code_for_RaspberryPi/04_PwmLed
Step 3: Compile
gcc PwmLed.c -o PwmLed -lwiringPi
Step 4: Run
sudo ./PwmLed
For Python users:
Step 2: Change directory
cd /home/pi/Sunfounder_SuperKit_Python_code_for_RaspberryPi/
Step 3: Run
sudo python 04_pwmLed.py
Now you will see the gradual change of the LED luminance, between bright and dim.
Summary
Through this experiment, you should have mastered the principle of PWM and how to
program Raspberry Pi with PWM. You can try to apply this technology to DC motor speed
regulation later.