Arduino Toolkit - @spidev/spidev
- :
dev =
spidev(ar, cspin)
- :
dev =
spidev(ar, cspin, propname, propvalue)
-
spidev
is depreciated and will be removed in a future version. Usedevice
instead.Create an spidev object to communicate to the SPI port on a connected arduino.
Inputs
ar - connected arduino object
cspin - chip select pin for attached spi device.
propname, propvalue - property name/value pair for values to pass to devices.
Currently known properties:
- bitrate
bit rate speed in Mbs
- bitorder
’msbfirst’ or ’lsbfirst’
- mode
SPI mode 0 - 3.
Outputs
dev - created spidev object
Properties
The spidev object has the following public properties:
- parent
The parent (arduino) for this device
- pins
pins used by this object
- mode
mode used for created object
- bitrate
Bitrate set for object
- bitorder
Bitorder set for object
- chipselectpin
Pin used for chipselect
See also: arduino, readWrite.