using API communications in C#
-
02 Februari 2012 3:57
Hi,
Does anyone know how to program XBee in API communications?
- Dipindahkan oleh Leo Liu - MSFT 03 Februari 2012 6:14 Moved for better support. (From:Visual C# Language)
Semua Balasan
-
03 Februari 2012 7:54Pemilik
I'm not sure that this is a Robotics question. XBee can be used for Robotics, but there RDS does not include a service for it so you would have to write your own. I think that the XBee controller on the PC end looks like a virtual serial port, so the Serial Port service might work.
Trevor
-
03 Februari 2012 8:21
Hi, This is what i receive from serial port (7E 00 12 92 0013 A2 00 40 6B 68 BB 4F 01 01 00 02 00 00 00 4F). How do I program it whenever it receive "7E" so that it will trigger the stopwatch?
Thank you.
-
05 Februari 2012 3:07Pemilik
I'm confused. This is still not a question about RDS. If you are already receiving the data, what is the difficulty in executing some code whenever you see a 7E in the data stream?
Trevor
- Diedit oleh Trevor TaylorMicrosoft Employee, Owner 05 Februari 2012 3:07
-
05 Februari 2012 4:26I need some starting guide codes to program whenever it receive "7E" to trigger the stopwatch.
-
06 Februari 2012 20:56Moderator
List<byte> streamBuffer = new List<byte>() { 0x7E, 0x00, 0x12, 0x92, 0x00, 0x13, 0xA2, 0x00, 0x40, 0x6B, 0x68, 0xBB, 0x4F, 0x01, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x4F }; foreach (byte value in streamBuffer) { if(value == 0x7E) { // Start StopWatch // If done with processing current streamBuffer break out of the foreach loop break; } else { continue; } }
- Disarankan sebagai Jawaban oleh Luke Thompson - MSFTMicrosoft Employee, Moderator 06 Februari 2012 20:56
- Ditandai sebagai Jawaban oleh Luke Thompson - MSFTMicrosoft Employee, Moderator 22 Februari 2012 9:26