GPIO not working with example code

Using this code, i tried to change the external led pin. I’ve tried with a couple of ones but doesn’t work. The only ones who actully seems to work are like “the middle ones” on P8. Tried to use the tops and bottom ones and nothing. ¿Does my BBB is damage?

var b = require(‘bonescript’);
var ledPin = “P8_25”;
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, 1000);

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

What size resistor are you using between the LED and the 3.3V rail?

Gerald

220 Ohms

Then you should be OK and should not have damaged the board.

Gerald

So it’s a software problem?

I don’t know. Maybe. You would need to get a response from a SW person on that portion.

Gerald

Okay! Thanks!

-Pablo Oyarzo

Using this code, i tried to change the external led pin. I've tried with a
couple of ones but doesn't work. The only ones who actully seems to work are
like "the middle ones" on P8. Tried to use the tops and bottom ones and
nothing. ¿Does my BBB is damage?

var b = require('bonescript');
var ledPin = "P8_25";

See http://beagleboard.org/support/bone101/#headers-black for a list
of pins already consumed by software resources.

See http://elinux.org/Beagleboard:BeagleBone_Black_FAQ#How_do_I_to_disable_the_HDMI_framer_so_I_can_use_the_LCD_pins_for_other_purposes.3F
for thoughts on how to open up access to those pins for other
software.

Thank you!

-Pablo Oyarzo

Hello Pablo,

you might like to have a look at
http://e2e.ti.com/support/embedded/starterware/f/790/t/308692.aspx.

It is about write protection when being in user mode.

Regards,
Martin