Skip to content

Commit

Permalink
Update MPUTeapot.pde
Browse files Browse the repository at this point in the history
Without that update, the packets were not aligned. I understand that '$' can be part of incoming packet but without this line, aligned was always 0.
  • Loading branch information
pagalFromAgra committed Oct 24, 2013
1 parent e2fa9a6 commit f7fd92e
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ void serialEvent(Serial port) {
while (port.available() > 0) {
int ch = port.read();
print((char)ch);
if (ch == '$') {serialCount = 0;} // this will help with alignment
if (aligned < 4) {
// make sure we are properly aligned on a 14-byte packet
if (serialCount == 0) {
Expand Down

0 comments on commit f7fd92e

Please sign in to comment.