Final code for data collection

This is the final code for the hardware end that will used for data
collection for the paper.