2 Replies Latest reply on Mar 23, 2015 12:11 PM by ForumMigrationAdmin

    Corrections to IoT Grove Rotary Angle JavaScript sample

    ForumMigrationAdmin

      The JavaScript sample on this page requires two corrections to work:  https://software.intel.com/en-us/iot/sensor/grove-rotary-angle

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

      //Instantiate Aio on Pin #0.

      var rotarySensor = new mraa.Aio(0);

      //Read sensor data function readRotaryValue(){

      Console.log ("Rotary Value: " + rotarySensor.read());

      //should be console.log }

      set Interval(readRotaryValue, 1000);

      //should be setInterval

       

      Change to:

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

      //Instantiate Aio on Pin #0. var rotarySensor = new mraa.Aio(0);

      //Read sensor data function readRotaryValue(){

      console.log("Rotary Value: " + rotarySensor.read()); }

      setInterval(readRotaryValue, 1000);