Arduino 上整数的串行消息 [英] Serial message to integer on Arduino
本文介绍了Arduino 上整数的串行消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我希望我的 Arduino 通过串行通信接收一个整数.你能帮我解决这个问题吗?
I want my Arduino to receive an integer through the serial communication. Can you help me with this?
它应该是这样的形式:
int value = strtoint(Serial.read());
推荐答案
您可以使用 Serial.parseInt() 函数,请参见此处:http://arduino.cc/en/Reference/ParseInt
You may use the Serial.parseInt() function, see here: http://arduino.cc/en/Reference/ParseInt
这篇关于Arduino 上整数的串行消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文