Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Honored Contributor I
1,104 Views

Corrections to IoT Grove Rotary Angle JavaScript sample

Jump to solution

The JavaScript sample on this page requires two corrections to work: https://software.intel.com/en-us/iot/sensor/grove-rotary-angle 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);


Accepted Solutions
Highlighted
Honored Contributor I
3 Views

Re: Corrections to IoT Grove Rotary Angle JavaScript sample

Jump to solution

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

Joe Butler

View solution in original post

2 Replies
Highlighted
Honored Contributor I
3 Views

Re: Corrections to IoT Grove Rotary Angle JavaScript sample

Jump to solution

Thank you. we will get this correct.

 

Ural

 

Highlighted
Honored Contributor I
4 Views

Re: Corrections to IoT Grove Rotary Angle JavaScript sample

Jump to solution

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

Joe Butler

View solution in original post