def check_bounds(value):
    """Check if the given value is out-of-bounds (0 to 4095)

    :args: the value to be checked
    :returns: the checked value
    """
    try:
        if int(value) > 4095:
            return 4095
        elif int(value) < 0:
            return 0
        else:
            return value
    except ValueError:
        print('Value was not a number, returned default value of 0')
        return 0
