Hello Community,
I have a problem, I would like to shoot several pictures by pressing the button once.
Maybe one every 1 second and that for 30 seconds.
I think this is about the Promise, but I do not know how.
<JavaScript>
var Observable = require("FuseJS/Observable");
var Camera = _camera;
var zaehler=Observable(1);
function capturePhoto() {
Camera.capturePhoto()
.then(function (photo) {
photo.save()
.then(function(filePath) {
photo.release();
zaehler.value++;
})
.catch(function(error) {
console.log("Failed to save photo: " + error);
photo.release();
});
})
.catch(function (error) {});
}
module.exports = {
capturePhoto: capturePhoto,
zaehler:zaehler,
};