零字符和串行端口 [英] Zero char and serial port
问题描述
伙计们:
有问题,我有可以与i2c系统配合使用的设备...
我最常发送串行命令来工作
例如,如果我想启动设备,我应该发送"S",然后在"A,B,C,D,E"之间进行选择,然后将字符发送到串行端口,则选择夹心式电动机,例如,如果我想要我的电动机以其65%的力量工作,我应该发送"A",向右或向左发送左左的"A"(右和)"B".最后,我发送以下命令:
serialport1.write("S/*(电动机启动)*/A/*(三明治电动机)*/A/*(例如65的功率)*/B/*(右转或左转)*/");
但是有一个问题,我是否要停止电动机,如何在串行端口中发送零个字符或发送一个字符????
============
来自JSOP:您是否对我的回答投了1分,因为我试图澄清您想要的内容?
hi guys :
there is problem , i have device that work with i2c system...
i most send the serial command to work
for example if i want to start device i should to send "S", then choose wich motor should the select between "A,B,C,D,E" and send char to serial port ,then the power for example if i want my motor work with 65 percent of his power i should to send "A" and for right or Left Should to send "A"(right , and)"B", left .in final i send this command :
serialport1.write("S/*(motors start)*/A/*(wich motor)*/A/*(power for example 65)*/B/*(right turn or left turn)*/");
but there is question if i want to stop the motor how can i send zero char in serial port or 1 char ????
=============
From JSOP: Did you vote my response a 1 because I was trying to get clarification on what you wanted?
推荐答案
Do您是说一个空字符还是一个"0"?
然后发送一个"0"字符,就像发送其他任何字符一样...
Do you mean a null character or a ''0''?
Just send a ''0'' character then, just like you would any other character...
这篇关于零字符和串行端口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!