上次发文,还是没搞定,我已经搞了1半,实在搞不下去了
SerialPort sp = new SerialPort();//和串口通讯,发到LED显示屏
byte[] b1 = new byte[31];
byte[] b2 = new byte[31];
int a0 = b1[0] - 160;
int a1 = b1[1] - 160;
int b = (94 * (a0 - 1) + (a1 - 1)) * 32;
FileStream fs = new FileStream(@"Hzk16", FileMode.Open, FileAccess.Read);
BinaryReader br = new BinaryReader(fs);
b1 = br.ReadBytes(b);
sp.Open(); //打开串口
sp.Write(b1, 0, 31); //发送
sp.Close();
说明下,如果b1是正确的数组,就可以在LED上显示正确的汉字了比如,
byte[] b1 = {0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfF,。。。。。}32个0xff就可以看到,LED的灯是全亮的,如果是0x00就不亮,问题是我中间那段好像有问题b1 = br.ReadBytes(b);无法编译,望高人解决啊
[此贴子已经被作者于2006-11-11 8:17:32编辑过]