These are chat archives for nebrius/raspi-io

13th
Feb 2015
Bryan Hughes
@nebrius
Feb 13 2015 03:43
@virgilvox, I just released v2.0.6 with a fix for your bug, thanks for your help in tracking it down
Moheeb Zara
@virgilvox
Feb 13 2015 18:36
@bryan-m-hughes you rock! I'll be sure to let you know if I find any other bugs :P I'll also send you a video soon of what this is for.
Bryan Hughes
@nebrius
Feb 13 2015 18:37
Awesome, can’t wait to see it!
Moheeb Zara
@virgilvox
Feb 13 2015 20:27
@bryan-m-hughes posted another issue! bryan-m-hughes/raspi-io#12
I can run one servo but not the other, and if I run one at a time they both point to the same PWM channel
Probably a quick fix. let me know if I can help
Bryan Hughes
@nebrius
Feb 13 2015 20:34
interesting, can you try it with the following code?
var raspi = require('raspi-io');
var io = new raspi();
io.on('ready', function() {
 var servo = 'P1-12';
 var servo2 = 'P1-35';

 this.pinMode(servo, io.MODES.PWM);
 this.pinMode(servo2, io.MODES.PWM); 

 this.analogWrite(servo, 255);
  this.analogWrite(servo2, 255);
});
Moheeb Zara
@virgilvox
Feb 13 2015 20:36
yea just a sec
      throw new Error('Unknown pin "' + pin + '"');
            ^
Error: Unknown pin "P1-12"
    at Raspi.Object.defineProperty.value [as __$271828_5$__] (/home/pi/raspi/node_modules/raspi-io/lib/index.js:264:13)
    at Raspi.Object.defineProperty.value [as pinMode] (/home/pi/raspi/node_modules/raspi-io/lib/index.js:273:43)
    at Raspi.<anonymous> (/home/pi/raspi/pw.js:7:7)
    at Raspi.emit (events.js:92:17)
    at /home/pi/raspi/node_modules/raspi-io/lib/index.js:237:10
Bryan Hughes
@nebrius
Feb 13 2015 20:37
that’s…strange
Moheeb Zara
@virgilvox
Feb 13 2015 20:37
yea
let me double check everything i've got the latest of everything
Bryan Hughes
@nebrius
Feb 13 2015 20:38
oh I know why that’s happening…I hard coded PWM to only use pin 1 since we didn’t have more than one PWM until very recently: https://github.com/bryan-m-hughes/raspi-pwm/blob/master/index.js#L31
Moheeb Zara
@virgilvox
Feb 13 2015 20:38
ahhh
I suspected that it was something like that
Bryan Hughes
@nebrius
Feb 13 2015 20:40
I’ll try and get a fix in as soon as I can…before I go to bed at the latest
Moheeb Zara
@virgilvox
Feb 13 2015 20:42
Sounds good, thanks for the quick responses and fixes!