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/]
'embeded > raspberry pi' 카테고리의 다른 글
라즈베리 파이 2 + usb webcam + servo 2ch (2) | 2015.09.28 |
---|---|
라즈베리 파이 PWM 데이터 시트 (0) | 2015.09.28 |
뻘짓은 하긴 했는데... (카메라 + 서보)*2 (0) | 2015.09.24 |
라즈베리 파이.. 오디오 캡쳐 장비가 없어?!?! (0) | 2015.09.22 |
JACK - JACK Audio Connection Kit (0) | 2015.09.22 |