Software Archive
Read-only legacy content
17061 Discussions

More than one PWM doesn't work.

Kirtan_S_
Beginner
721 Views

On Intel XDK IOT edition, 

I tried:

var mraa=require("mraa");

var mypwm=mraa.pwm(9,-1,false);

mypwm.enable(true);

mypwm.period_us(2000);

mypwm.write(0.5)//half the value

This works fine. But when I bring in another pwm value:

var mraa=require("mraa");

var mypwm=mraa.pwm(9,-1,false);

var mypwm2=mraa.pwm(10,-1,false);

This causes an error. I tried building it, uploading it, all sorts of things. Is there a way where I can have multiple PWM outputs without bringing up an error?

0 Kudos
1 Solution
Matthias_H_Intel
Employee
721 Views

Kirtan S. wrote:

On Intel XDK IOT edition, 

I tried:

var mraa=require("mraa");

var mypwm=mraa.pwm(9,-1,false);

mypwm.enable(true);

mypwm.period_us(2000);

mypwm.write(0.5)//half the value

This works fine. But when I bring in another pwm value:

var mraa=require("mraa");

var mypwm=mraa.pwm(9,-1,false);

var mypwm2=mraa.pwm(10,-1,false);

This causes an error. I tried building it, uploading it, all sorts of things. Is there a way where I can have multiple PWM outputs without bringing up an error?

I checked: Mraa doesn’t support PWM on IO10,  Only the default “swizzler” states. Libmraa wouldn't know if you modify those hence has to assume the defaults

View solution in original post

0 Kudos
3 Replies
Matthias_H_Intel
Employee
721 Views

could you pls check which version of libmraa you have installed?

0 Kudos
Kirtan_S_
Beginner
721 Views

I have the latest version from http://iotdk.intel.com/repos/1.1/intelgalactic

0 Kudos
Matthias_H_Intel
Employee
722 Views

Kirtan S. wrote:

On Intel XDK IOT edition, 

I tried:

var mraa=require("mraa");

var mypwm=mraa.pwm(9,-1,false);

mypwm.enable(true);

mypwm.period_us(2000);

mypwm.write(0.5)//half the value

This works fine. But when I bring in another pwm value:

var mraa=require("mraa");

var mypwm=mraa.pwm(9,-1,false);

var mypwm2=mraa.pwm(10,-1,false);

This causes an error. I tried building it, uploading it, all sorts of things. Is there a way where I can have multiple PWM outputs without bringing up an error?

I checked: Mraa doesn’t support PWM on IO10,  Only the default “swizzler” states. Libmraa wouldn't know if you modify those hence has to assume the defaults

0 Kudos
Reply