Average voltage is proportional to duty cycle.
WiringPi and Pulse-Width-Modulation with Raspberry Pi
by Lewis Loflin
YouTube video see Pulse-Width-Modulation with Raspberry Pi.
WiringPi allows one use Arduino type programming with the Raspberry Pi GPIO. Here I'll explore how this is used and how it differs from Arduino.
I'll connect Raspberry Pi to a LED using pulse-width modulation to control intensity.
PWM in Arduino is 8-bit in WiringPi it's 10-bit. If one uses Raspberry Pi 2 or 3 pins 1 and 26 are the same thing - PWM on 1 is also on 26! WiringPi is native to the newest version of Raspbian. One must be root to use. Remember Arduino is 5-volts and RPi is 3.3-volts!
This is written in C and has to be compiled. I suggest using Geany under Linux. Get it "sudo apt-get install geany-plugins".
WiringPi was developed by Gordon Henderson.
Complete code: pwmRpi.txt
- Raspberry Pi Openbox Desktop 2019
- WiringPi and Pulse-Width-Modulation with Raspberry Pi
- WiringPi for Raspberry Pi and MAX6675 thermal-couple sensor
- WiringPi Blink an LED Demo
- Interface I2C LCD to Raspberry Pi in C
- ADS1115 4-Channel ADC Uses I2C with Raspberry Pi
- MCP4725 12-Bit DAC Interface to Raspberry Pi
- Raspberry Pi with PCF8591 Analog To Digital Control in C
- Raspberry Pi PCF8591 AD-DA Sensor Python Interface
- Web Master
- Bristol VA/TN
- US Constitution
- Religious Themes
- Religion Archive 1
- Gen. Electronics
- YouTube Channel
- Arduino Projects
- Raspberry Pi & Linux
- PIC18F2550 in C
- PIC16F628A Assembly
- PICAXE Projects