All Pull Up

The „Pull Up“ sketch is of course more interesting than the previous high Z sketch.

//
//	www.blinkenlight.net
//
//	Copyright 2011 Udo Klein
//
//	This program is free software: you can redistribute it and/or modify
//	it under the terms of the GNU General Public License as published by
//	the Free Software Foundation, either version 3 of the License, or
//	(at your option) any later version.
//
//	This program is distributed in the hope that it will be useful,
//	but WITHOUT ANY WARRANTY; without even the implied warranty of
//	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//	GNU General Public License for more details.
//
//	You should have received a copy of the GNU General Public License
//	along with this program. If not, see http://www.gnu.org/licenses/


void setup() {
	for (uint8_t pin=0; pin<20; ++pin) {
		pinMode(pin, INPUT);
		digitalWrite(pin, HIGH);
	}
}

void loop() { }

All LEDs light up. But not equally bright. Most are pretty dim, LED 13 is very dim and LED 0 is brighter than all the rest.

Blinkenlight Prototype Pullups On

But why? The sketch enables the pullup resistors. Then all Arduino pins will be internally connected to 5V through a 10-47k resistor. This is enough to light them up but very dim though. Pin 13 has an additional LED connected on the Arduino board itself. Hence LED 13 gets less current than all the others. As we already found above LED 0 is driven by the serial interface. Thus it gets significantly more current than all the others. Hence it is much brighter.

With the next sketch we will pull all pins to low. Although this seems boring there is something to learn.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s