Home \ Help \ Search \ Login RSS

Welcome, Guest. Please Login

This forum is now READ-ONLY! Please visit http://forum.wiring.co/ for the new forum.

Wiring ForumProgramming Questions & HelpSyntax › portRead/portWrite?

Page Index Toggle Pages: 1
portRead/portWrite? (Read 3838 times)
02/04/07 at 05:20:59

roy_pardi   Offline
YaBB Newbies
Boston USA

Posts: 49
Hi again,

So I am working on a project that is using 48 pins as outputs (yay Wiring for lots of pins!). These are each connected to a transitor circuit to turn a light on or off.

For purposes of speed (and my learning), rather than address each pin individually I am thinking of using portWrite().

Am I correct in thinking that I can set various high/low patterns for a port using portWrite()?  (I think yes). And this will be faster than sending data for 8 pins separately. (I guess yes).

Hoping to finally get a handle on bitwise operations with this project...

IP Logged
Reply #1 - 02/04/07 at 08:41:43

barragan   Offline
YaBB Administrator

Posts: 939
yes, you're right, try running a program like this:

for(int i = 0; i<256; i++) {
  portWrite(portNumber, i);
  delay(100); //just to let you see the light patterns for a moment.

IP Logged
Page Index Toggle Pages: 1