我想通过串行从Arduino向RaspberryPi 3B +传输十个双精度数组。最后一个数字效果很好,但其他数字会定期中断。有没有办法让RaspberryPi等待某个起始位,以便接收整个字符串?
这是我当前代码的接收部分:
class ChildClass : SuperClass() {
private val innerClass: InnerClass? = InnerClass()
init {
// beware: this is ONLY done because toOverride ONLY calls
// innerClass.doSomething(), you have to make sure that anything else
// there is idempotent
toOverride()
}
override fun toOverride() {
innerClass?.doSomething()
}
}
然后将字符串分成几段,效果很好。