Assignment: Serial Packetizer

by Coach Cindy

February 10 2020 Robotics


Summary

This is a sample code for Ethan's serial communication assignment on repl.it.


Full text

In the Serial parketizer on repl.it, Ethan asked all to implement the methods for serial communication between two Arduino. The send method takes in an array of bytes, and sends them down the serial object with the delimiters and escape sequences we discussed. There are also two helper functions for "escaping" and "unescaping" bytes - using these lets the tester better check your work. When you encounter a byte to be send that needs escaping, send escape(byte), and use unescape() to "undo" escape().

Below is a sample code for a state machine and the receive method that Ethan wrote up in our last class. We couldn't debug the code due to time constrains so all BananaBots members should work on it and get it run successfully , meaning that your code must pass all the test cases that Ethan pre-defined on the repl website.




About the author


Coach Cindy - BananaBots head coach

Cindy has years of experience in IT and project management. As the lead supervisor of BananaBots, she hopes that, one day, the younger generation will show their true power through their efforts and persistence.


More posts by Coach Cindy