title: How to Calculate Checksum in Arduino/C++?
body: <p>I'm developing an ESP32(Arduino) interface to communicate to a Fingerprint Device.
  But I have no idea about the checksum.
  I found documentation for the Fingerprint device as below.</p>
  
  <p><a href="https://i.stack.imgur.com/RnMnk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RnMnk.png" alt="enter image description here"></a></p>
  
  <p>For example, some of the data packets are followed:</p>
  
  <p><a href="https://i.stack.imgur.com/YiDZK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YiDZK.png" alt="enter image description here"></a></p>
  
  <p>Here, the checksum of the corresponding command packets are.
  <strong>06 01, F7 02, FA 02, F8 03, FA 02, F9 03</strong></p>
  
  <p>My question is How can I calculate the checksum for a new data packet in Arduino/ C++, for example:</p>
  
  <p>the data packet is:</p>
  
  <p><strong>AA 55 04 01 04 00 00 00 F4 FF 00 00 00 00 00 00 00 00 00 00 00 00 00 ?? ??</strong></p>
  
  <p>What will be the Process?</p>
  
  <p>Thank you!</p>