New features for HCScreen library

With the new functions you can now do it in the menus colorful.

It is thus possible to change the text color and or the background color in the middle of the Text. Positioning is also possible. To achieve these effects, control characters are simply built into the text to be displayed.

  • 02 = text color: after the control character, three Bytes with the color values for red, green and blue must follow. Note that the value 0 must not be used (String end). Uses 1 instead, which makes no difference. Byte values can easily be built into a String by simply placing a "\" in front of it. Attention the following numerical value is expected as octal number or with preceding X as hexadecimal number. 
    Example:" \2\377\xff\10Test " means
    \2 = 2 text color 
    \377 = 255 value for red
    \xff = 255 value for green
    \10 = 8 value for blue
    Test = text to be output
  • 03 = background color: also here follow three Bytes for red, green and blue with the same rules as for the text color
  • 01 = reset all color changes (text color and background color to the default values.
  • 04 = Position: this is followed by a Byte with the position in the line where the text output is to be continued. This makes it very easy to display tables.

Another innovation applies to the Joystick control. It is no longer necessary to program the query of the Joystick Pins in the main loop itself, this is now done simply by a function of the HC-Screen library. It is only necessary to use the Initjoy function to tell the library the Pins to which the Joystick has been connected and to pass a so-called Callback function, which is called whenever the internal Joystick Handler something to the main program want to report. In this Callback function, the library passes the Information in which mode the Display is located.

  • HC_NONE = 0
  • HC_MENU = 1
  • HC_ICONS = 2
  • HC_FILE =5
  • HC_STATIC = 6

In the main loop, a call to the function handleJoy() must be installed so that the library can respond to the Joystick.

The library can be accessed from  HCScreen Library download. In the Arduino IDE, simply import the ZIP File from the Download in the library Manager.


Leave a comment

All comments are moderated before being published

Recommended blog posts

  1. Install ESP32 now from the board manager
  2. Lüftersteuerung Raspberry Pi
  3. Arduino IDE - Programmieren für Einsteiger - Teil 1
  4. ESP32 - das Multitalent
  5. OTA - Over the Air - ESP programming via WLAN