Example #1
0
def getImage():
    global camera
    global time_between_picture
    global nightMode

    imageFile = None
    if camera == None:
        camera = camara.initCamera()
        camara.resolucionHD()
        utils.myLog('Waiting {}s  for camera warn'.format(TIME2INITCAMERA))
        time.sleep(TIME2INITCAMERA)
    if camera != None:
        if nightMode:
            utils.myLog('nigth Mode')
            camara.addDateNight()
            imageFile = camara.getImageNight()
        else:
            if datetime.datetime.now().hour >= 20 or datetime.datetime.now(
            ).hour < 7:
                camara.addDateNight()
            else:
                camara.addDate()
            imageFile = camara.getImage()
    if time_between_picture == 0 or time_between_picture > 10000:
        camera = camara.closeCamera()
    return imageFile
Example #2
0
def init():
    global camera
    arduinoSerialPort, puertoDetectado = arduinoUtils.detectarPuertoArduino()
    if (puertoDetectado != ''):
        utils.myLog("\n ** ARDUINO CONECTADO EN " + puertoDetectado + " ** ")
        if arduinoSerialPort != None:
            riego.init(arduinoSerialPort)
        else:
            utils.myLog("None Arduino Port")
    camera = camara.initCamera()
Example #3
0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
    Test of cámara functionality
    Licencia CC by @javacasm    
    Julio de 2020
 """

import camara
from time import sleep

camera = camara.initCamera()  # creamos el objeto camara


def testISO():
    for iso in range(100, 900, 100):
        message = 'ISO:' + str(iso)
        print(message)
        camara.addText(message)
        camara.setIso(iso)
        camara.getImage()


def testImage():
    for i in range(1, 3):
        camara.addDate()
        camara.getImage()
        sleep(5)


def testImageNight():