9.6 Arduino Shiftregister Functions

9.6.1 @shiftRegister/delete

: delete (dev)

Free resources of a shiftRegister object.

Inputs

dev - object to free

See also: shiftRegister.

9.6.2 @shiftRegister/display

: retval = display (register)

Display the register object in a verbose way,

Inputs

register - the arduino register object created with shiftRegister.

See also: shiftRegister.

9.6.3 @shiftRegister/read

: retval = read (register)
: retval = read (register, precision)

read a value from the shift register.

Inputs

register - shift register created from shiftRegister call.

precision - optional precision of the data, where precision can be a number in a multiple of 8 (ie: 8,16,32) or can be a named integer type: 8 of ’uint8’, ’uint16’, ’uint32’. The default precision is 8.

Outputs

retval - returned data read from the register.

See also: shiftRegister, write.

9.6.4 @shiftRegister/reset

: reset (register)

clear the shift register value.

Inputs

register - shift register created from shiftRegister call.

See also: shiftRegister, read, write.

9.6.5 @shiftRegister/shiftRegister

: register = shiftRegister (ar, shifttype, dataPin, clockPin ...)
: register = shiftRegister (ar,'74hc164', dataPin, clockPin, resetPin)
: register = shiftRegister (ar,'74hc165', dataPin, clockPin, loadPin, clockEnablePin)
: register = shiftRegister(ar,'74hc595', dataPin, clockPin, latchPin , resetPin)

Create shift register of a given type, controlled by the input pins.

Inputs

Common function parameter definition:

ar - connected arduino object.

shifttype - string name of the shift register type.

dataPin - pin used for data in/out of the device.

clockPin - pin used for clocking data on the shiftRegister.

Other variables are dependent on the shift register type:

’74hc164’

Additional inputs:

resetPin - optional pin for resetting the shift register.

’74hc165’

Additional inputs:

loadPin - load pin to the shift register. clockEnablePin - clock enable pin.

’74hc595’

Additional inputs:

latchPin - latching data to the shift register. resetPin - optional pin for resetting the shift register.

Outputs

register - register object

Properties

The shiftRegister object has the following public properties:

parent

The parent (arduino) for this device

pins

pins used by this object

model

model set for object

See also: arduino.

9.6.6 @shiftRegister/subsref

: val = subsref (dev, sub)

subref for shiftRegister

See also: shiftRegister.

9.6.7 @shiftRegister/write

: write (register, dataIn)
: write (register, dataIn, precision)

Write a value to the shift register.

Inputs

register - shift register created from shiftRegister call.

dataIn - data to clock into the shiftRegister.

precision - optional precision of the data, where precision can be a number in a multiple of 8 (ie: 8,16,32) or can be a named integer type of ’uint8’, ’uint16’, ’uint32’. The default precision is 8.

See also: shiftRegister, read.


Next: Arduino SPI Functions, Previous: Arduino Servo Functions, Up: Function Reference   [Contents][Index]