embeded/raspberry pi2015. 9. 28. 08:29


void pinMode (int pin, int mode) ;

This sets the mode of a pin to either INPUT, OUTPUT, or PWM_OUTPUT. Note that only wiringPi pin 1 (BCM_GPIO 18) supports PWM output.


void pwmWrite (int pin, int value) ;

Writes the value to the PWM register for the given pin. The value must be between 0 and 1024. (Again, note that only pin 1 (BCM_GPIO 18) supports PWM)


pwmSetMode (int mode) ;

The PWM generator can run in 2 modes – “balanced” and “mark:space”. The mark:space mode is traditional, however the default mode in the Pi is “balanced”. You can switch modes by supplying the parameter: PWM_MODE_BAL or PWM_MODE_MS.


pwmSetRange (unsigned int range) ;

This sets the range register in the PWM generator. The default is 1024.


pwmSetClock (int divisor) ;

This sets the divisor for the PWM clock.


[링크 : https://projects.drogon.net/raspberry-pi/wiringpi/functions/]


LED PWM 예제 - c언어 / wiring pi

[링크 : https://learn.sparkfun.com/tutorials/raspberry-gpio/c-wiringpi-example]


python / pwm 2 ch 예제

[링크 : http://electronut.in/controlling-two-servos-with-hardware-pwm-on-the-raspberry-pi-model-a/]

Posted by 구차니