1 Reply Latest reply on May 15, 2015 9:13 AM by Intel_Peter

    Correct method of setting period and dutycycle PWM (MRAA, NodeJS)

    MarkOg

      I'm trying to get a simple PWM controlled motor running from the Edison, using the NodeJS part of MRAA.

       

      The most basic test script I could think of:

       

      var m = require('mraa');

      var motorPin = new m.PWM(3);

      motorPin.config_percent(1,0.4f);

      motorPin.enable();

       

       

      Fails:

       

      /home/root/motor.js:3

      motorPin.config_percent(1,0.4f);

                                ^^^

      SyntaxError: Unexpected token ILLEGAL

       

      What's the correct way of setting the period and dutycycle of a PWM pin in NodeJS?