74595 shift register

How do you control (for lack of a better word) the output pins on a 74595 shift register? Is it possible to declare them as input/output pin as you would on an arduino?
Any help needed,
jaredpi

Perhaps this is a useful library (haven't tried it myself though) Arduino Playground - ShiftRegister595 Library

You can't declare a pin on 595 to be output. With proper library you may be able to hide the complex (or not so) 595 logic and simply do a digitalWrite_595(5,HIGH). It's not the point. Learning how the 595 (a general shift register) works is part of the fun.

There are 8 or 16 port "port-expanders" which connect via I2C or SPI. These allow pins to be set as input or output.

Perhaps this is a useful library (haven't tried it myself though) Arduino Playground - HomePage

I tried that and there were several error messages:

In file included from sketch_jun22a.cpp:1:
C:\Users\Michael Acord\Desktop\jared\arduino-1.0.1\libraries\ShiftRegister595/ShiftRegister.h:11:22: error: WProgram.h: No such file or directory
In file included from sketch_jun22a.cpp:1:
C:\Users\Michael Acord\Desktop\jared\arduino-1.0.1\libraries\ShiftRegister595/ShiftRegister.h:15: error: 'byte' has not been declared
C:\Users\Michael Acord\Desktop\jared\arduino-1.0.1\libraries\ShiftRegister595/ShiftRegister.h:17: error: 'byte' has not been declared
In file included from sketch_jun22a.cpp:2:
C:\Users\Michael Acord\Desktop\jared\arduino-1.0.1\libraries\ShiftRegister595/ShiftRegister595.h:16: error: expected `)' before 'userLatchPin'
C:\Users\Michael Acord\Desktop\jared\arduino-1.0.1\libraries\ShiftRegister595/ShiftRegister595.h:18: error: 'byte' has not been declared
C:\Users\Michael Acord\Desktop\jared\arduino-1.0.1\libraries\ShiftRegister595/ShiftRegister595.h:20: error: 'byte' has not been declared
C:\Users\Michael Acord\Desktop\jared\arduino-1.0.1\libraries\ShiftRegister595/ShiftRegister595.h:23: error: 'byte' has not been declared
C:\Users\Michael Acord\Desktop\jared\arduino-1.0.1\libraries\ShiftRegister595/ShiftRegister595.h:24: error: 'byte' does not name a type
C:\Users\Michael Acord\Desktop\jared\arduino-1.0.1\libraries\ShiftRegister595/ShiftRegister595.h:25: error: 'byte' does not name a type
C:\Users\Michael Acord\Desktop\jared\arduino-1.0.1\libraries\ShiftRegister595/ShiftRegister595.h:26: error: 'byte' does not name a type
C:\Users\Michael Acord\Desktop\jared\arduino-1.0.1\libraries\ShiftRegister595/ShiftRegister595.h:27: error: 'byte' does not name a type
sketch_jun22a:9: error: no matching function for call to 'ShiftRegister595::ShiftRegister595(byte&, byte&, byte&)'
C:\Users\Michael Acord\Desktop\jared\arduino-1.0.1\libraries\ShiftRegister595/ShiftRegister595.h:14: note: candidates are: ShiftRegister595::ShiftRegister595()
C:\Users\Michael Acord\Desktop\jared\arduino-1.0.1\libraries\ShiftRegister595/ShiftRegister595.h:14: note: ShiftRegister595::ShiftRegister595(const ShiftRegister595&)

jaredpi:

Perhaps this is a useful library (haven't tried it myself though) Arduino Playground - HomePage

I tried that and there were several error messages:

In file included from sketch_jun22a.cpp:1:
C:\Users\Michael Acord\Desktop\jared\arduino-1.0.1\libraries\ShiftRegister595/ShiftRegister.h:11:22: error: WProgram.h: No such file or directory
In file included from sketch_jun22a.cpp:1:
C:\Users\Michael Acord\Desktop\jared\arduino-1.0.1\libraries\ShiftRegister595/ShiftRegister.h:15: error: 'byte' has not been declared
C:\Users\Michael Acord\Desktop\jared\arduino-1.0.1\libraries\ShiftRegister595/ShiftRegister.h:17: error: 'byte' has not been declared
In file included from sketch_jun22a.cpp:2:
C:\Users\Michael Acord\Desktop\jared\arduino-1.0.1\libraries\ShiftRegister595/ShiftRegister595.h:16: error: expected `)' before 'userLatchPin'
C:\Users\Michael Acord\Desktop\jared\arduino-1.0.1\libraries\ShiftRegister595/ShiftRegister595.h:18: error: 'byte' has not been declared
C:\Users\Michael Acord\Desktop\jared\arduino-1.0.1\libraries\ShiftRegister595/ShiftRegister595.h:20: error: 'byte' has not been declared
C:\Users\Michael Acord\Desktop\jared\arduino-1.0.1\libraries\ShiftRegister595/ShiftRegister595.h:23: error: 'byte' has not been declared
C:\Users\Michael Acord\Desktop\jared\arduino-1.0.1\libraries\ShiftRegister595/ShiftRegister595.h:24: error: 'byte' does not name a type
C:\Users\Michael Acord\Desktop\jared\arduino-1.0.1\libraries\ShiftRegister595/ShiftRegister595.h:25: error: 'byte' does not name a type
C:\Users\Michael Acord\Desktop\jared\arduino-1.0.1\libraries\ShiftRegister595/ShiftRegister595.h:26: error: 'byte' does not name a type
C:\Users\Michael Acord\Desktop\jared\arduino-1.0.1\libraries\ShiftRegister595/ShiftRegister595.h:27: error: 'byte' does not name a type
sketch_jun22a:9: error: no matching function for call to 'ShiftRegister595::ShiftRegister595(byte&, byte&, byte&)'
C:\Users\Michael Acord\Desktop\jared\arduino-1.0.1\libraries\ShiftRegister595/ShiftRegister595.h:14: note: candidates are: ShiftRegister595::ShiftRegister595()
C:\Users\Michael Acord\Desktop\jared\arduino-1.0.1\libraries\ShiftRegister595/ShiftRegister595.h:14: note: ShiftRegister595::ShiftRegister595(const ShiftRegister595&)

I'd suggest reading the "Read this before posting a programming question" sticky, especially point #2

I think you have some 022 023 ver code, only thing I know about it is to look at the Sketch, header and cpp files and change and instance of wprogran.h to arduino.h. That is what works for me most of the time.

Doc