Software Archive
Read-only legacy content
17061 Discussions

Corrections to IoT Grove Rotary Angle JavaScript sample

toadaze
Beginner
636 Views

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

//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);

 

0 Kudos
2 Replies
Raghavendr_U_Intel
636 Views

Thank you. we will get this correct. 

0 Kudos
Joseph_B_Intel
Employee
636 Views

It's been fixed. Thanks for pointing it out Marvin.

Joe

0 Kudos
Reply