A PiFace Control and Display board.
Attribute : | switch_port – See pifacecommon.mcp23s17.MCP23S17RegisterNeg. |
---|---|
Attribute : | switches – list containing pifacecommon.mcp23s17.MCP23S17RegisterBitNeg. |
Attribute : | lcd – See pifacecad.lcd.PiFaceLCD. |
Example:
>>> cad = pifacecad.PiFaceCAD()
>>> hex(cad.switch_port.value)
0x02
>>> cad.switches[1].value
1
>>> cad.lcd.write("Hello, PiFaceLCD!")
>>> cad.lcd.backlight_on()
Listens for events on the switches and calls the mapped callback functions.
>>> def print_flag(event):
... print(event.interrupt_flag)
...
>>> listener = pifacecad.SwitchEventListener()
>>> listener.register(0, pifacecad.IODIR_ON, print_flag)
>>> listener.activate()
An IR event.
Listens for IR events and calls the registered functions. prog specifies
>>> def print_ir_code(event):
... print(event.ir_code)
...
>>> listener = pifacecad.IREventListener(prog="myprogram")
>>> listener.register('one', print_ir_code)
>>> listener.activate()
When activated the IREventListener will run callbacks associated with IR codes.
When deactivated the IREventListener will not run anything.
Maps an IR code to callback function.
Waits for IR code events and places them on the event queue.
Parameters: | event_queue (multiprocessing.Queue) – A queue to put events on. |
---|
Control Port for an HD44780 LCD display. Must have the following properties:
- backlight_pin
- read_write_pin
- register_select_pin
- enable_pin
Data Port for an HD44780 LCD display. Must have the following properties:
- value
Component part of an HD4780, must be combined with a 4 or 8 bit mixin.
Turn on the backlight.
Turn on the backlight.
Turns off the blinking cursor.
Turns on the blinking cursor.
Raises an exception if char_bank is out of bounds. Returns True otherwise.
Parameters: | char_bank (int) – The address to check. |
---|
Clears the display.
Returns address of column and row.
Parameters: |
|
---|---|
Returns: | The address of the column and row. |
Turns the underline cursor off.
Turns the underline cursor on.
Turns the display off (quickly).
Turns the display on (quickly).
Returns the current column and row of the cursor. Also fixes internal value.
Returns: | (int, int) – A tuple containing the column and row. |
---|
Moves the cursor to the home position.
Left justifies text from the cursor.
Sets the text to flow from left to right.
Scrolls the display without changing the RAM.
Scrolls the display without changing the RAM.
Pulse the LCD clock for reading data.
Right justifies text from the cursor.
Sets the text to flow from right to left.
Moves the viewport so that the cursor is visible.
Send command byte to LCD.
Parameters: | command (int) – The command byte to be sent. |
---|
Start using CGRAM at the given address.
Parameters: | address (int) – The address to start at (default: 0) |
---|
Places the cursor at the specified column and row.
Parameters: |
---|
Start using DDRAM at the given address.
Parameters: | address (int) – The address to start at (default: current) |
---|
Stores a custom bitmap bitmap at char_bank.
Parameters: |
---|
Update the display control to reflect the displaycontrol.
Update entrymodeset to reflect the displaymode.
Updates the function set to reflect the current displayfunction.
The top left corner of the current viewport.
A custom bitmap for the LCD screen.
An HD44780 LCD in 4-bit mode.