什么是派出最好的方式float,double以及int16通过串行上的Arduino?
float
double
int16
的Serial.print(),因为只有发送值ASCII编码.但我想将值作为字节发送.Serial.write()接受字节和字节数组,但是将值转换为字节的最佳方法是什么?
Serial.print()
Serial.write()
我试着投了int16一个byte*,没有运气.我也使用了memcpy,但它使用了很多CPU周期.Arduino使用普通的C/C++.这是一款ATmega328微控制器.
byte*
c c++ serial-port bytearray arduino
arduino ×1
bytearray ×1
c ×1
c++ ×1
serial-port ×1