Closed spuder closed 9 years ago
Still not sure what 0 maps to, but I found the following table https://github.com/sarfata/pi-blaster/blob/master/pi-blaster.c#L39-51
static uint8_t known_pins[] = {
4, // P1-7
17, // P1-11
18, // P1-12
27, // P1-13
21, // P1-13
22, // P1-15
23, // P1-16
24, // P1-18
25, // P1-22
};
Hi i think the number 0 in piblaster.setPwm(0, 0.4) actualy refers to first pin in known_pins, which is pin 4 (P1-7)
I used pi-blaster.js with PiBits/ServoBlaster which allows for passing array of pins you want to use.
With pi-blaster you are stuck with known_pins.
Since pi-blaster is a fork of ServoBlaster you should have no problem to use it instead and use pins you want.
Hope it helps.
Thanks,
This is how I eventually got it working
piblaster.setPwm(17, red/255 );
piblaster.setPwm(22, green/255 );
piblaster.setPwm(23, blue/255 );
https://github.com/spuder/rpi-redditbutton/blob/master/button.js#L10-12
The example shows setting first pin to 40%
What does 0 map to? Is it the GPIO/Broadcom mapping because there isn't a pin 0.
http://pi.gadgetoid.com/pinout