you can do it 2 ways:
1 -
Force kill: You need to get Raspistill PID:
Dim pgrep As Shell
pgrep.Initialize("Raspistill_GetPID", "pgrep", Array("raspistill"))
then kill using the PID:
Dim kill As Shell
kill.Initialize("Raspistill_Kill", "kill", Array("-9", PID))
2 -
"Ask to kill": Kill raspistill gently:
Dim sh As Shell
sh.Initialize("Raspistill_Kill", "pkill", Array("raspistill"))
The second option seems to not force kill the process. more about that:
You could also loop and take pictures one after the other (remove the -tl), because I see your timelapse is 2 second interval, and taking 1 picture takes 1 second:
(code is written from memory, not tested
)
dim picNumber as int = 0
sub takePics
dim t as timer
t.initialize("takePic", 2000)
t.enabled = true
end sub
sub takePic_Tick
dim sh as shell
sh.initialize("takePic", "raspistill", Array("-t", "1", "-o", "myImage" & picNumber & ".jpg"))
sh.run(-1)
end sub
sub takePic_ProcessFinished (stdou ....
picNumber = picNumber + 1
end sub
[edit] make sure you read correctly what -t does. In a timelapse, that's the time it will run the timelapse. In normal picture mode, that's the time it will wait before taking a snapshot.