blinkled.js doesn't work for me

Hello,
I am trying to run the blinkled.js program from the Cloud9 IDE. When I run it in Cloud9 on the B^3, nothing happens to my led. I have Ground going to the resistor, the resistor going to the short connector on the led and the long connector of the led going to pin 13. If I take the same program and run it by typing node blinkled.js at the BASH prompt, I get an error message:

error b.pinmode at line 6
^
object # has no method pinmode

Anyone know why this would be happening?

Thanks for your time!

What size is the resistor that you are using?

Gerald

Hello,
I am trying to run the blinkled.js program from the Cloud9 IDE. When I
run it in Cloud9 on the B^3, nothing happens to my led. I have Ground
going to the resistor, the resistor going to the short connector on the led
and the long connector of the led going to pin 13. If I take the same
program and run it by typing node blinkled.js at the BASH prompt, I get an
error message:

error b.pinmode at line 6
           ^
object #<object> has no method pinmode

Case matters in JavaScript. Try b.pinMode.

I tried 470 ohms and 220 ohms.

That fixed it! I ran node blinkled.js and it worked. Still no luck getting it to work on Cloud 9 though. :confused:

I was able to figure it out.
If you look at analog.js, it uses the same pin for LED’s. To turn the LED off/on, you need to write b.analogWrite(outputPin, value);.

Seeing that the analog.js program was working perfectly, I tried it on the blinked.js and it worked!
In blinked.js under the toggle function, replace the “b.digitalWrite(ledPin, state);” with “b.analogWrite(outputPin, value);” and your LED’s should both start blinking.