Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // @00RD0000000157*
- // 0123456789012345
- char Mat[64];
- char Result[64];
- String Dados;
- int QteBytes;
- byte FCS = 0;
- //--------------------------------------
- void setup()
- {
- Serial.begin(9600);
- }
- //--------------------------------------
- void loop()
- {
- if (Serial.available())
- {
- Dados = Serial.readString();
- Serial.print ("Recebido ");
- Serial.println(Dados);
- QteBytes = Dados.length();
- Dados.toCharArray(Result,(QteBytes-2));
- for (int i = 0; i <=(QteBytes-2); i++)
- {
- FCS = FCS^Result[i];
- }
- Serial.print ("FCS calculado ");
- Serial.println(FCS,HEX);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement