implement auto scan

1. I modified the file main.js to implement auto scan.
2. Since I think that it is reasonable to repeatedly take picture until a qrcode is successfully captured, I implemented this function with setInterval() instead of setTimeout() (which only run takepicture() once).
3. I set the delayed time in 1 second.