SPI.transfer, one byte or many?
i'm having trouble spi device thought go basics , check reference.
however arduino website states "transfers one byte on spi bus, both sending , receiving. " (http://arduino.cc/en/reference/spitransfer). on http://arduino.cc/en/tutorial/spidigitalpot gives following example:
void digitalpotwrite(int address, int value) {
digitalwrite(slaveselectpin,low);
spi.transfer(address);
spi.transfer(value);
digitalwrite(slaveselectpin,high);
}
the single spi.transfer command transferring 2 bytes (an integer). if had device needed several parameters pass array spi.transfer , cycle through elements?
however arduino website states "transfers one byte on spi bus, both sending , receiving. " (http://arduino.cc/en/reference/spitransfer). on http://arduino.cc/en/tutorial/spidigitalpot gives following example:
void digitalpotwrite(int address, int value) {
digitalwrite(slaveselectpin,low);
spi.transfer(address);
spi.transfer(value);
digitalwrite(slaveselectpin,high);
}
the single spi.transfer command transferring 2 bytes (an integer). if had device needed several parameters pass array spi.transfer , cycle through elements?
quote
if had device needed several parameters pass array spi.transfer , cycle through elemen
no.
Arduino Forum > Using Arduino > Programming Questions > SPI.transfer, one byte or many?
arduino
Comments
Post a Comment