Skip to content

Enahancement: As a user user I need to define a character for undefined characters, or change the segment mapping for an existing character #2

@fourstix

Description

@fourstix

Enhancement (Request for Review and Comment)

As a user user I need to define a character for undefined characters, or change the segment mapping for an existing character.

Please see this issue in my fork of this repository
fourstix#1

Your workbench

  • Sparkfun Redboard with Qwiic
    
  • Qwiic Alphanumeric Display - Blue SPX-16426
    
  • Sparkfun_Alphanumeric_Display_Library v1.0.0
    
  • Qwiic Cable
    
  • Redboard powerd via USB; Display powered via Qwiic
    

Steps to reproduce

Please see this issue in my fork of this repository for the enhancement code and more details.
fourstix#1

I welcome your comments and suggestions before I create a pull request with this function.

This code has been tested with all the examples and is ready to be merged. However I would appreciate any suggestions to improve the code before merge.

Proposed solution:

  1. Move character mapping table from function static variable to class static
  2. Expand character mapping table array from 90 to 96, to cover all printable characters
  3. Add a new function defineChar(char c, uint16_t segment_map) to change the segment mapping data in the array.
  4. The defineChar function should accept characters from '!' (33) to '~' (126)
  5. The segment_map should be masked to 14 bits representing segments a through n.
  6. Space (32) should remain blank and DEL/Unknown (128) should remain all segments on, or '0x3FFF' in 14 bits.

Expected behavior

Adding this function to the library will allow users to update the character segment mapping to display their own graphics for a character.

Actual behavior

Today there is no function available to do this. Character graphics is a matter of taste, and different
users will have different preferences. Users unsatisfied with a character on the display, would be able to change it easily.

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