cloud9 bonescript interrupt problems

Hi folks,
About interrupt in the sample code from “input.js” in beaglebone cloud9

attachInterrupt(inputPin, function(x) {
digitalWrite(ledPin, x.value);

When I push the input button, led blinked same as the other output pin in “loop” function.
Question is how it work , I had search on google, but found nothing.

Another question is when I change the code to:

setup = function(){

attachInterrupt(inputPin, function() {
digitalWrite(ledPin, HIGH);


loop = function (){



The led pin change to HIGH status and then change to LOW only one time.
After that, whatever I push the input pin , there is nothing happen.
Why the interrupt only executive once?

I have the same problem. I got around it by polling the input pin to generate an interrupt myself. Would want to know the reason why bonescript interrupt doesn’t work repeatedly.

But why the sample code is worked?

function(x) {
digitalWrite(ledPin, x.value);
Do you know the meaning of " x.value"?
Thank you.

Same problem here. My interrupt-handler works some time, after some seconds
or few minutes (there is no clear rule) I get no response from the interrupt
handler. I took a look on the pin states, the levels change the right way.

Maybe we have a bonescript problem?

There was a reported issue that could cause garbage collection to
impact the handler. A fix has been applied.

Note that if you pull the latest bonescript, there are some
significant architecture changes to try to scale better in the
JavaScript world. Notably, globals have been eliminated along with

I have a setGlobals() function that might bring that functionality
back for you if you absolutely need it:
var b = require('bonescript');

I never test with that as I've determined it just doesn't work well
when you want to do fun javascripty things.

I'm in the process of refactoring attachInterrupt, but that may take a bit.

Hi!!! I have updated my board with the latest bonescript but I’m still having the same problem. The attachInterrupt only fires once and that’s it, I’m running the code using Cloud9.
How ever when I use the attachInterrupt demo;

It works. Is it still an issue with bonescript or with Cloud9.

Urgently need help with this issue…