Intel® Makers
Intel® Edison, Intel® Joule™, Intel® Curie™, Intel® Galileo
Welcome - This is a Peer-to-Peer Forum only. Intel has discontinued these products but you may find support from other customers on this Forum
9881 Discussions

Turning on LED on Edison board


Using Twitter's API, I have written a command to send an alert whenever a Tweet containing specific words is found in my news timeline. These words are currently broken out into three different arrays. I would now, however, like to use this alert to turn on an LED whenever a word in one of these arrays is found.

This is the code I am using for the LED:

var groveSensor = require('jsupm_grove'); 

var led = new groveSensor.GroveLed(3); 


I am just not sure how to display it in my API... Currently, I have the code at the top, before the API, and then the "on" / 'off" command after each array. This has only resulted in the LED's turning off, though.

var params = {screen_name: 'myusername'}; 

client.get('statuses/home_timeline', params, function(error, tweets, response) {

if (!error) { 

for (var i=0;i for (var ii=0;ii if(tweets[i].text.indexOf(techArray[ii])>-1&&tweets[i].id_str*1>lastId) {

console.log("-----found a tech article - " + tweets[i].text + "-------"  

+ tweets[i].text.indexOf(techArray[ii]));


var led = new groveSensor.GroveLed(3); 



else {

var led = new groveSensor.GroveLed(3);; 


Any idea where/how I should actually write this command?

0 Kudos
1 Reply
Community Manager

Hello madisoncrusso,



Thank you for your interest in the Intel® Edison Breakout Board.



I have to inform you that code debugging is out of the scope of this technical support team.



I noticed that you posted your inquiry here, I'll suggest you to follow Whitney's suggestion and create an independent LED.js file to test the code that you want to add to the API.



For more information on using the Edison module with Twitter, you may want to check the following links:



If you have any question related to the Edison module, don't hesitate to contact us.



Have a nice day.





Andres V.