<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hans,<div><br><div>The pins are best set up for connecting them to ground and using the internal pull up resistors. When using them to pull things down they will want to draw real current.</div><div> Unfortunately pins 5 to 8 span ports b and c so there is no tidy and elegant way that would be significantly better than reading the pins using the arduino. You can do the multiply by shifting the bits but any reasonable compiler should figure this out for you so even that is kind of mute. </div><div><br></div><div>Don.</div><div> </div><div><br><div><div><div>On Jan 1, 2009, at 3:49 PM, Hans Lindauer wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>A few easy questions for those in the know. I have a DIP (SIP, actually) switch connected to pins 5-8 of my dorkboard(s) and to +5V, and want to read in the switches as as number.<br><br>1. Can I safely connect +5V to a digital input (or 4), and leave it high for an extended period without having to worry about overheating or other issues? Probably a dumb question, I know, but I'm still learning the ins and out of this stuff.<br><br>2. Do I need pull-down resistors to ground on each of the digital pins? I guess I don't understand the necessity of that. Also, is my terminology correct?<br><br>3. What's an elegant way to read those pins in as a byte? I know I can multiply the pin value by 2^n and add them all up, but it seems like there's got to be a smarter way. Maybe I can read a register with the pin values and mask off those bits?<br><br>Thanks in advance,<br>-Hans<br>_______________________________________________<br>dorkbotpdx-blabber mailing list<br><a href="mailto:dorkbotpdx-blabber@dorkbot.org">dorkbotpdx-blabber@dorkbot.org</a><br><a href="http://music.columbia.edu/mailman/listinfo/dorkbotpdx-blabber">http://music.columbia.edu/mailman/listinfo/dorkbotpdx-blabber</a><br></div></blockquote></div><br></div></div></div></body></html>