Software Archive
Read-only legacy content
公告
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17060 讨论

More than one PWM doesn't work.

Kirtan_S_
初学者
787 次查看

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 项奖励
1 解答
Matthias_H_Intel
787 次查看

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 项奖励
3 回复数
Matthias_H_Intel
787 次查看

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

0 项奖励
Kirtan_S_
初学者
787 次查看

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

0 项奖励
Matthias_H_Intel
788 次查看

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 项奖励
回复