Software Archive
Read-only legacy content
Announcements
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 Discussions

Corrections to IoT Grove Rotary Angle JavaScript sample

toadaze
Beginner
770 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
770 Views

Thank you. we will get this correct. 

0 Kudos
Joseph_B_Intel
Employee
770 Views

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

Joe

0 Kudos
Reply