> For the complete documentation index, see [llms.txt](https://alfredo-reyes-montero.gitbook.io/amikoo/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://alfredo-reyes-montero.gitbook.io/amikoo/norman/software/aplicaciones/uppboard/camera.md).

# Camera

This application allows the robot to use his camera and take a photo and save it to a specific directory. This app is the base for the next application that allow that google api, tell us what is it.

* First we need to import the libraries that we are going to use.&#x20;

```
import os
import datetime
import shutil
import time
```

* Explaining the code.
  * First we kill every instants of eog, this allow us to don't have any demon running.&#x20;
  * Then we extract the date, so we could make a unique id for each photo.
  * We use os.system("")  to give it instruction as we do on terminal.&#x20;
  * We take the photo using the command fswebcam, and we define some parameters.
  * We move the photo to a specific directory.
  * We show the photo taken for 3 second and we kill it.

```
def main():
  os.system("killall -9 eog")
  now = datetime.datetime.now()
  name = str(now.year)+"-"+str(now.month)+"-"+str(now.day)+"-"+str(now.hour)+"-"+str(now.minute)+"-"+str(now.second)
  name = str(name)+".jpg"
  os.system("fswebcam -r 800x480 --jpeg 80 --no-banner --save " + name)
  os.system("mv "+name+" /home/lupe/Desktop/photos/"+name)
  os.system("eog -f /home/lupe/Desktop/photos/"+name+" &")
  time.sleep(3)
  os.system("killall -9 eog")
  return 0  

if __name__ == '__main__':
 main()
```
