Ejemplo n.º 1
0
import st7036

ROWS = 3
COLS = 16

lcd = st7036.st7036(register_select_pin=25, reset_pin=12)
lcd.clear()


def write(value):
    """Write a string to the current cursor position.

    Args:
        value (string): The string to write
    """
    lcd.write(value)


def clear():
    """Clears the display and resets the cursor."""
    lcd.clear()


def set_contrast(contrast):
    """Sets the display contrast.

    Args:
        contrast (int): contrast value
    Raises:
        TypeError: if contrast is not an int
        ValueError: if contrast is not in the range 0..0x3F
Ejemplo n.º 2
0
Archivo: lcd.py Proyecto: pcarver/dot3k
from sys import exit

try:
    import st7036
except ImportError:
    exit(
        "This library requires the st7036 module\nInstall with: sudo pip install st7036"
    )

ROWS = 3
COLS = 16

lcd = st7036.st7036(register_select_pin=25)
lcd.clear()


def write(value):
    """Write a string to the current cursor position.

    Args:
        value (string): The string to write
    """
    lcd.write(value)


def clear():
    """Clears the display and resets the cursor."""
    lcd.clear()


def set_contrast(contrast):
Ejemplo n.º 3
0
Archivo: lcd.py Proyecto: GeorgN/dot3k
import st7036

ROWS = 3
COLS = 16

lcd = st7036.st7036(register_select_pin=25)
lcd.clear()

def write(value):
    """Write a string to the current cursor position.

    Args:
        value (string): The string to write
    """
    lcd.write(value)
    
def clear():
    """Clears the display and resets the cursor."""    
    lcd.clear()
    
def set_contrast(contrast):
    """Sets the display contrast.

    Args:
        contrast (int): contrast value
    Raises:
        TypeError: if contrast is not an int
        ValueError: if contrast is not in the range 0..0x3F
    """     
    lcd.set_contrast(contrast)
    
Ejemplo n.º 4
0
            camera.capture(IMG_PATH_ORIGINAL + ".tmp.jpg")
            os.rename(IMG_PATH_ORIGINAL + ".tmp.jpg", IMG_PATH_ORIGINAL)

            print("Trying to parse license plate...")
            parseLicensePlate(IMG_PATH_ORIGINAL)

        cv2.destroyAllWindows()
        alpr.unload()


##### MAIN ENTRY

print("Started license plate recognition script")

lcd = st7036.st7036(register_select_pin=22,
                    rows=1,
                    columns=8,
                    spi_chip_select=0)
lcd.set_display_mode()
lcd.set_contrast(40)
lcd.clear()
time.sleep(1)

try:
    _thread.start_new_thread(start_license_plate, ())
    _thread.start_new_thread(start_webserver, ())
except:
    print("Error: Could not start threads!")

while True:
    time.sleep(50)
    pass