All High Z

The „High Z“ sketch is almost as simple as the most basic 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/


// This sketch sets all input pins to "high z".
// That is they will be high impedance / floating.

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

void loop() { }

It sets all pins to input and disables any pullup resistors. It exhibits the same behavior as the „empty“ sketch we started with. It only serves to demonstrate that this is the „default“ behavior of the Arduino.

The output looks exactly the same compared to the “Empty” sketch.

Blinkenlight Prototype High Z

The next sketch will be more interesting. We will pull up all pins.

4 Responses to All High Z

  1. Peter says:

    Hi,
    your shield does also work physically on Arduino mega 2560, but a hint would be helpful
    that looping through all pins from 0 to 19 does not work on 2560.
    The last five LEDs are wired to symbolic pins A0-A5, which are physically the pins 54 to 59, not 14
    to 19. So some mapping function would be helpful to get a consecutive sequence of pins.
    Peter

    • Hi Peter,

      the same issue was brought up with this comment before. This is tricky. Basically my shield and the experiments are designed for “standard” Arduinos and the Blinkenlighty. I know that the other Arduino variants share the same connector they are not 100% software compatible. However I do not own all these variants and thus can not test appropriately. The question is who should provide the hint. In my opinion this should be stated in the manuals / wikis of the Arduino variants. And of course somewhere you will find it. On the other hand I do not like to be blamed for things that are out of my control. I would be willing to provide such a hint on my pages. The solution to the comment I mentioned above is not that obvious to find. So here comes my question to you: where on my pages would you expect such a comment and how extensive should it be?
      Udo

      • Peter says:

        Hi Udo,
        I overlooked that, sorry. Even one hour of googling did not show your solution…
        I found a plenty of discussions where people complained about the pin numbering stuff and the lack of information on the Arduino site. The best source was the source code…
        As I got the Franzis pack with the shield only and no information on compatibility besides a link to your blog, the first impulse was to look for the physical compliance in Experiments->Hardware.
        One extra entry for “Compatibility” with a “works with… ” table would be fine. People could add comments on additional working boards. In an extra column you could add a column indicating if your sketches work “unmodified/with modification” on a given Arduino type and provide a link to the modification as an extra page in Experiments (or moving all sketches one level down to “Experiments->Sketches” and adding the modification page there.
        Peter

        • Good idea to put it to Hardware. This month I will most probably not find the time to add this page. However I aim to add it in September.

          The best source was the source code…

          Hehe, the best source is always source code. The truth is in the code 😉

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.