Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
I have a programming question. I wish to write a hex number to the spi.write (hexnumber). How do I do that?
SPI spi(p5, p6, p7);
serial pc(USBTX, USBRX); // tx, rx
main () {
char str[2];
pc.printf ("\n Please type hex number to be written: ");
pc.scanf ("%s", &str); // don't think this is correct. Please advice.
spi.write (str);
}