[dorkbotpdx-blabber] Just a question re: Dorkboard
Aaron
aaron.m.walker at gmail.com
Mon Jan 26 13:51:44 EST 2009
That explains it. Thank you. (I should have read the schematic).
Aaron
On Mon, Jan 26, 2009 at 10:09 AM, Donald Delmar Davis
<ddelmardavis at gmail.com> wrote:
> The led on the dorkboard (and the arduino in general) is connected from the
> supply to the pin through a resistor.
> The pin sinks the current so LOW is on.
> On Jan 26, 2009, at 9:25 AM, Aaron wrote:
>
> Hello, just got done with the induction yesterday, and playing with my
> dorkboard today.
>
> I hooked an additional LED up to pin 12, and am playing with modifying
> the little blink program.
>
> int ledPin = 13; // LED connected to digital pin 13
> int ledPin2 = 12;
>
> void setup()
> {
> pinMode(ledPin, OUTPUT); // sets the digital pin as output
> pinMode(ledPin2, OUTPUT);
> }
>
> void loop()
> {
> digitalWrite(ledPin, HIGH); // sets the LED on
> digitalWrite(ledPin2, HIGH); // sets the LED on
> delay(1500); // waits for a second
> digitalWrite(ledPin, LOW); // sets the LED off
> delay(1500); // waits for a second
> digitalWrite(ledPin2, LOW); // sets the LED off
> delay(1500); // waits for a second
> }
>
> One would expect this would turn on both LEDs, then wait a second,
> turn off LED1, wait, turn off LED2, wait, and then turn both on again.
> Instead it turns on LED2, waits, turns on LED1, Turns off LED2, turns
> off LED1, then repeats. In order to get the behavior I'm wanting, I
> had to do this
>
> int ledPin = 13; // LED connected to digital pin 13
> int ledPin2 = 12;
>
> void setup()
> {
> pinMode(ledPin, OUTPUT); // sets the digital pin as output
> pinMode(ledPin2, OUTPUT);
> }
>
> void loop()
> {
> digitalWrite(ledPin, LOW); // sets the LED on
> digitalWrite(ledPin2, HIGH); // sets the LED on
> delay(1500); // waits for a second
> digitalWrite(ledPin, HIGH); // sets the LED off
> delay(1500); // waits for a second
> digitalWrite(ledPin2, LOW); // sets the LED off
> delay(1500); // waits for a second
> }
>
> Is there something wrong with my board? Have I declared something
> oddly? Why does 13 being set "high" turn the LED off, and being set
> low turn it on?
>
> - Aaron @jarvitron
> _______________________________________________
> dorkbotpdx-blabber mailing list
> dorkbotpdx-blabber at dorkbot.org
> http://music.columbia.edu/mailman/listinfo/dorkbotpdx-blabber
>
>
> _______________________________________________
> dorkbotpdx-blabber mailing list
> dorkbotpdx-blabber at dorkbot.org
> http://music.columbia.edu/mailman/listinfo/dorkbotpdx-blabber
>
More information about the dorkbotpdx-blabber
mailing list