Skip to content

Character_LCD set_backlight function is backwards #5

Closed
@BravoDelta151

Description

@BravoDelta151

If you pass True, the value is set to 0 (False) turning the backlight off and you must pass False to turn it on.

Additionally, a quick review of the init function defaults the self.backlight member to None which will cause an exception if you don't pass in the pin and attempt to call set_backlight since None has no 'value' member.

def set_backlight(self, lighton):
      """ Set lighton to turn the charLCD backlight on.
            :param lighton: True to turn backlight on, False to turn off
      """
      if lighton:
        self.backlight.value = 0
      else:
        self.backlight.value = 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions