//水平按钮 SUIPIN: function () { var that = this that.XSJZCX() //that.XSJZCX() 这是一个蓝牙控制舵机的函数 //因为不知道舵机动作完成的准确时间, //所以想在收到蓝牙通讯的返回信息后,进行下一步动作 //蓝牙通讯的返回信息正常, receiveText == 'BBW@' //下面这段代码是错误的,准确的代码应该怎样写呢? while (that.data.receiveText == 'BBW@' ) { //下一步动作 } }, // 这是蓝牙通讯返回数据代码,工作正常,receiveText == 'BBW@' wx.onBLECharacteristicValueChange(function (res) { var receiveText = app.buf2string(res.value) console.log('接收到数据1:' + receiveText) that.setData({ receiveText: receiveText }) } |
请各位老师赐教