Two changes (should have been separate commits, but too late now!):
1. Logging now writes messages to both log file and console.
2. After a PIR detection, the sonic ranger takes three measurements.
   This is meant to prevent missing a detection due to the PIR firing
   before the target is within range of the ultrasonic.
I also extended the default ranger settletime to 0.5 seconds to help with
point 2 above.
Moved the logger setup code outside the try-except block in main.py
and corrected a typo in one of the logger messages.
Added the DETECT_SAMPLES parameter to parameters.py.  (It had been
introduced to the Ranger class in a previous commit, but there
was no way of changing the default value.)