Examples are running backwards

Hi everyone,

I am trying again to see if I can adapt and use the imp, however I have been struggling. With the new IDE I decided to try again. So I did the example in the getting started which lets me turn on or off an led over the net. Super excited, it works!!! http://electricimp.com/docs/gettingstarted/3-agents/. However I am trying to understand why it would be backwards. According to the documentsation and from my understanding of the code, 1=On and 0=off! But its backwards for me. 1=Off and 0=On. Why would that be? I copied and pasted the example code exactly.

Thank you.

Sounds like your circuit might have something backwards? I’d check that first… LEd in the correct way… Is the LED going to GND or VCC?

I tried reversing wires and doesn’t work at all then.

I am setup identical to: http://electricimp.com/docs/gettingstarted/2-helloworld/

I figured it out, there is a problem with the example doc. The image does not match the instructions. See:


Connect the positive (long) lead of the LED to the 3v3 pin of the imp.
Connect the negative (short) lead of the LED to one end of a 330Ω resistor.
Connect the other end of the 330Ω resistor to pin9 of the imp.

Image appears correct, instructions incorrect. Right?

They are different… both will technically work, but as you saw, the configuration in the instructions turns the LED on when PIN 9 is pulled to GND.

So yes, the image is correct with respect to the example.

Thank you for your help. Super stoked this is working. Feel free to mess with my LED. lol. button

:slight_smile: I messed. Hope you saw it.

I did. Lol. Thank you!

Even though it was hosted at “donotactivate.org” I couldn’t resist either :stuck_out_tongue:

haha, I saw! :slight_smile:

Thanks for catching the bug in our documentation @StartGroup - I’ll make sure that gets fixed :slight_smile:

You’re Welcome! :slight_smile: