It's time for a new activity.
And in this activity you will practice with the Raspberry Pi camera module.
So here's your challenge.
You will need to take a series of photo.
So you take one new photo every for example every five seconds.
And you're going to store all those photos inside a folder okay.
You continue to take photos as long as the program runs.
And then when the user stops, the user is going to be you.
When you stop the program with Ctrl C from the terminal, also from the shell, then you're going to
stop taking photos so the program will exit.
And here are a few tips to help you get started.
So first of all, if you remember we have the OS module and you have a way to find if the path exists
so that you already know, then if it doesn't exist.
So if the folder doesn't exist, you're going to use OS dot mkdir and provide a folder name.
So we will need to use this function here.
For the folder name you can use whatever you want okay.
For example activity ten or whatever.
So if the folder doesn't exist you create it.
And I'm not sure if I showed that to you before, but if you want to test that something is true, you
do if okay.
And then for example, something if this is true, you do something.
For example, I put this block here, but if you want to execute this block, if this is false.
What you can do is you can add a not keyword.
So for example here, if you test if it doesn't exist, you can just test if it exists and put the not
keyword in front.
And it's going to return the opposite of true or false.
So if it's true this is going to be false.
Okay.
If this is false then this is going to be true.
All right.
So here you will be able to use the Not keyword.
So if not the folder exists then we create the folder.
Great.
And then you will initialize the camera.
And you will need to take a photo.
So with a loop probably a loop every five seconds.
Now if you use the same file name every time, what you saw previously is that the new folder will replace
the previous one.
And what you want to do here instead is to take a new.
So to create a new file name every time you take a new photo.
So for example the first file would be image one dot jpg and then image two dot jpg, image three,
etc..
All right.
So in the loop you will need to find a way to create a new file name every time.
So you will need to increment a number.
And also to work with concatenation of strings.
And then once again when the user presses Ctrl C the program is going to end.
All right.
Now that's enough information for you to get started.
And I will see you in the next video for the solution.