fixed some bugs

fixed bug where ADC was not stopping when reaching specified sample
count.
Changed the way data is transmitted to base station to prevent data
overflow and loss at the base station side.