This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

spi程序修改

Other Parts Discussed in Thread: CC2640R2F

cc2640r2f中spi发送的是字符形式的,怎么修改才能让它发送数字形式的呢??

  • SPI发送的本来就是二进制信号,字符是后面加代码进行转换的。你定义一个数组,把你要发数字的十六进制填进去,不转化呗
  • 看看ASII码表就知道了,发送的是16进制数,你需要发送的是16进制对应的数字,然后接受进行转换就好了。
    比如你想发送数字2,你可以发送0x02,接收端直接16进制接收。也可以发送0x32,表示字符串2,接收端做字符串接收,判断Rx=='2',或者判断RX-0x30 == 0x02也可以。