Hi all,
I am pretty new around. I am working on controlling a Digital Synthesizer through its serial interface using the Arduino Due SPI option. Everything starts in Matlab GUI where I write a sequence like "07,04,5D" and so on. The Arduino reads the sequence and tries to send through the SPI port the data:
SPI.transfer(0x07)
SPI.transfer(0x04)
However, given the way I get the data and how it should be organized to address different options in the synthesizer, I really get a char variable thischar='0x07' and then try to write the SPI. Something like this:
char bufferchar[SPIstring.length()+1];
SPIstring.toCharArray(bufferchar, SPIstring.length()+1);
SPI.transfer(bufferchar);
Where SPIstring is the string with the command I need to write.
The error given by the compiler is
sketch_mar13a.ino: In function 'void loop()':
sketch_mar13a:93: error: invalid conversion from 'char*' to 'uint8_t'
sketch_mar13a:93: error: initializing argument 1 of 'byte SPIClass::transfer(uint8_t, SPITransferMode)'
I would appreciate suggestions on how to get the char sequence translated into the right format to use the SPI.transfer.
Thanks a lot!
Juan