Serial, sending entire byte array
hello, have problem sending data through serial arduino.
when try send data winaplication, have following sniffer log(free serial monitor), see attachment. (there string sent entire data)
when sending using arduino, seems sends each byte apart, see attachment.
ps:
1. serial ports virtual, i'm using virtual serial ports driver xp
2. combination winapp(server) + winapp(clinet) - works fine.
3. i'm using proteus emulate arduino.
when try send data winaplication, have following sniffer log(free serial monitor), see attachment. (there string sent entire data)
when sending using arduino, seems sends each byte apart, see attachment.
ps:
1. serial ports virtual, i'm using virtual serial ports driver xp
2. combination winapp(server) + winapp(clinet) - works fine.
3. i'm using proteus emulate arduino.
code: [select]
void setup() {
serial.begin(9600);
}
void loop() {
//20051010bb
byte cmd[]={0x20,0x05,0x10,0x10,0xbb};
serial.write(cmd,sizeof(cmd));
delay(3000) ;
}
try this, should loop thru of array cmd[]
code: [select]
//20051010bb
byte cmd[]={0x20,0x05,0x10,0x10,0xbb};
byte x;
void setup() {
serial.begin(9600);
}
void loop() {
for (x =0; x<sizeof(cmd); x=x+1){
serial.write(cmd[x]);
}
delay(3000) ; // why need this?
}
Arduino Forum > Using Arduino > Networking, Protocols, and Devices (Moderator: fabioc84) > Serial, sending entire byte array
arduino
Comments
Post a Comment