Community
cancel
Showing results for 
Search instead for 
Did you mean: 
AFila1
Novice
1,364 Views

I can't run PWM on Intel Romeo board

Hi,

I'm using Intel XDK. The code is:

var mraa = require("mraa"); //require mraa

var pwm3 = mraa.Pwm(9);

pwm3.enable(true);

pwm3.period_us(2000);

var value = 0.0;

setInterval(function () {

if (value >= 1.0) {

value = 0.0;

}

value = value + 0.03;

pwm3.write(value); //Write duty cycle value.

console.log(pwm3.read());//read current value that is set before.

}, 3000);

and it rise error. Mraa version 0.9.0

ERROR: /home/root/.node_app_slot/main.js:24

ERROR: var pwm3 = mraa.Pwm(9);

^

ERROR: Error: Illegal arguments for construction of _exports_Pwm

at Object. (/home/root/.node_app_slot/main.js:24:18)

at Module._compile (module.js:456:26)

at Object.Module._extensions..js (module.js:474:10)

at Module.load (module.js:356:32)

at Function.Module._load (module.js:312:12)

at Function.Module.runMain (module.js:497:10)

at startup (node.js:119:16)

at node.js:935:3

3 Replies
Pablo_M_Intel
Employee
112 Views

Hi AndrikFilatov,

I just ran your code and didn't have any issue with it. Could you please answer the following questions?

  • Which version of node are you using?
  • Which version of the XDK are you using?
  • Did you update to mraa 0.9.0 using the "Update libraries on board" option?
  • Which Edison image are you using?

Regards,

PabloM_Intel

AFila1
Novice
112 Views

Hi Pablo,

I have checked and I have the last verions. I have tryed with Edison Board from Groove Kit and It's work. I think the question is in the Romeo board. Did you run it on Romeo board?

Andrey

Pablo_M_Intel
Employee
112 Views

Hi AndrikFilatov,

Unfortunately we don't a have a Romeo board to test it. But after reading some specs and information about the Romeo board I believe that there might be some compatibility issues. All the information provided makes reference to the Arduino IDE, there's nothing related to the XDK. They also mention the use of the "Atmel mega 8 as Analog pins driver", and the XDK IoT Edition is meant to be used with Intel-based IoT platforms. But I would suggest you to contact the support team at http://www.dfrobot.com/forum/ DFRobot for more information.

Regards,

PabloM_Intel

Reply