fixes a bug where the period == 0
adds new driver code for the HC-SR04 chip