pi-lcd-0.1.0.0: Control an Adafruit character LCD and keypad kit on a Raspberry Pi

Copyright© Patrick Pelletier 2017
LicenseBSD3
Maintainercode@funwithsoftware.org
Safe HaskellSafe
LanguageHaskell2010

System.Hardware.PiLcd.UserInterface

Contents

Description

Displays a simple user interface. The first line of the display is used as a "list box", where the user can scroll through a list of items one at a time using the up and down buttons. The second line of the display is used for virtual "buttons", such as "OK" and "Cancel". The user uses the left and right buttons to select a virtual "button". When the user presses the Select button, the interaction is considered done, and the calling program is given the list item and button selection that the user made.

Synopsis

User interface

data UiData Source #

The data to be displayed in the user interface.

Constructors

UiData 

Fields

  • udList :: [Text]

    items to be displayed one-at-a-time on the first line

  • udButtons :: [Text]

    buttons to be displayed on the second line

data UiState Source #

The current state of the user interaction.

Constructors

UiState 

Fields

defaultUiState :: UiState Source #

Defaults to displaying the first list item (index 0) and highlighting the first button (index 0).

runUi Source #

Arguments

:: UiData

Data to display in the UI

-> UiState

Current state of the interaction

-> Maybe ButtonEvent

optional button press/release

-> Int

Number of columns in the LCD

-> ([Text], UiState, Bool)

text to display, new UI state, and a flag indicating whether the interaction is done (i. e. user has pressed and released the "Select" button)

Computes the text which should be displayed for the current state of the UI, and optionally applies a button press/release to the state.

Buttons

data ButtonDirection Source #

Indicates whether a button was pressed or released.

Constructors

Press 
Release 

Instances

Bounded ButtonDirection Source # 
Enum ButtonDirection Source # 
Eq ButtonDirection Source # 
Ord ButtonDirection Source # 
Read ButtonDirection Source # 
Show ButtonDirection Source #