我用STC单片机,向arduino板通过串口不停的循环发送:
$1170904,00&
$1120904,01&
$1170904,02&
$1170904,03&
$1120904,04&
$1170904,05&
$1170904,06&
$1120904,07&
$1170904,08&
$1170904,09&
$1170904,10&
$1120904,11&
$1170904,12&
$1170904,13&
$1170904,00&
$1120904,01&
$1170904,02&
$1170904,03&
$1120904,04&
$1170904,05&
$1170904,06&
$1120904,07&
$1170904,08&
$1170904,09&
$1170904,10&
$1120904,11&
$1170904,12&
$1170904,13&
想用arduino板把接收到的数据转换成数组 ,如接收到$1170904,13& 转换为numdtat[13] 的值等于1170904;
char temp;
while(Serial.available()>0)
{
temp =Serial.read();
if (temp == '$')
{
}
}
具体怎么转换就搞不清了,哪位大侠给指导一下,谢谢!急!
|
|