Can't run the default blinkled.js program with Cloud 9 IDE

So I followed the instructions in the Bad to the Bone manual to run the blinkled.js script on the board. However, I don’t think it is working at all. I have the board connected to the USB port of my PC and connected via Ethernet as well. I do not have an external LED attached to port P8_13, as I’m not sure where that is. There are no Pin numbers printed on the board and I am not 100% sure where to begin looking. I figured not having the external LED would be okay and that it shouldn’t affect the USR LED from blinking (was that a correct assumption?).

In any event, I don’t really notice any rhythmic blinking in any of the LEDs (except for the one that is pre-configured to mimic a heartbeat). They seem to just be blinking at random times and with random intensities. (I can take a video upon request, if you guys think it will help me figure out what is going on.). I know at least one of them blinks whenever the eMMC is accessed or something like that. So where should I begin trouble shooting with this issue?

Here is the blinkled.js code for your reference:

`

var b = require(‘bonescript’);

var ledPin = “P8_13”;
var ledPin2 = “USR3”;

b.pinMode(ledPin, b.OUTPUT);
b.pinMode(ledPin2, b.OUTPUT);

var state = b.LOW;
b.digitalWrite(ledPin, state);
b.digitalWrite(ledPin2, state);

setInterval(toggle, 5000);

function toggle() {
if(state == b.LOW) state = b.HIGH;
else state = b.LOW;
b.digitalWrite(ledPin, state);
b.digitalWrite(ledPin2, state);
}

`

Somethings I’ve already tried with the code, that haven’t worked:

  • Changing the USR
  • Changing the interval
  • Commenting out the code for the external LED
    Thanks in advance for any help.

Regards,

BeagleNoob (at least I’m trying to crawl before I’m trying to run).

Hi,

1- Try disconect the ethernet cable. The example works in mine and i haven’t connect it through ethernet so far, just usb.
2- The external LED isn’t necesary. Check carefuly the USR LED that is all the way to the left, right next to the ethernet cable.
3- Try “Run”, not “Debug” the program in cloud IDE. To change it, in case you have on debug mode, clic the arrow right next to the button, and will display a submenu and then deselect “Run in debug mode”.

Hope you find this helpful.

Hello Pablo,

Thanks for your suggestions. I removed the Ethernet cable, and it seemed to work at first. That is, it blinked at an interval of 1000 milliseconds. To test it out further, I changed the interval to 500 ms (and also to 2000 ms), saved the code and ran it again. However, this time, it didn’t blink at all. It just stayed lit. Do you have any thoughts on this? Thank you!

Hi!

Glad it worked! Now, i have the same problem. i resolve it everytime it happens to me with just disconecting and conecting again the BBB. I know this is not the good way but i’ve asked and none has given me a good answer. Another thing, Do the step 3 of my last comment, doesnt matter if you have o no any problem, because the “debug” action can give a couple of problems with regular programing.

-Pablo Oyarzo.

Ah, I understand. Hopefully it’s just a bug that will eventually get fixed. Thanks so much for taking the time out to help me. Have a great day, Pablo!

That’s why this group exist! haha! And it’s my pleasure! :slight_smile:

-Pablo Oyarzo