Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- copyBuffer = new byte[375];
- //If receive 0xAA, start count how many 0xAA are
- Console.WriteLine("Hello");
- while (AAcnt <= 5) {
- Byte receivedValue = (Byte)port.ReadByte();
- // read one byte
- if (receivedValue == 0xAA)
- {
- AAcnt++;
- }
- else
- {
- AAcnt = 0;
- }
- }
- port.Read(copyBuffer, 7, 368);
- AAcnt = 0;
- Console.WriteLine("hand_cnt:" + hand_cnt);
- for (int i = 7; i < 375; i++)
- Console.Write(copyBuffer[i] + ",");
- Console.WriteLine();
- hand_cnt++;
- if (hand_cnt == 100)
- hand_cnt = 0;
Advertisement
Add Comment
Please, Sign In to add comment