Comments: Everything You Should Know About HyperDisplay

Pages

Looking for answers to technical questions?

We welcome your comments and suggestions below. However, if you are looking for solutions to technical questions please see our Technical Assistance page.

  • I've attempted to add an alternative font size to the hyperdisplay library, but I would appreciate some help. I began by adding the microview 8x16font.h bitmap from geekammo's repository (https://github.com/geekammo/MicroView-Arduino-Library/blob/master/font8x16.h). I copied the getCharInfo() method in hyperdisplay.cpp, and I'm attempting to rework the algorithm for the 8x16font.h, however, I'm running into some issues. When I try writing out the bitmap on graphing paper I end up with gibberish, and the size is still 5x7 unless I swap indi and indj here (I don't think this is a valid option):

    if(values[indi] & (0x01 << indj))
    

    From what I understand, the display does not support fonts with heights larger than eight pixels. Each character has to be split into two pieces that are displayed seperately with one below the other giving the illusion of a single character. I'm still running into issues though.

    Here is the link to my modified code that I'll push to your repo once I've finished: https://github.com/iangchristensen/SparkFun_HyperDisplay_Library/blob/master/SparkFun_HyperDisplay_Library/src/hyperdisplay.cpp

  • Any advice on switching out the default font to a larger one? I went to the source of the 5x7 font: https://github.com/geekammo/MicroView-Arduino-Library and found several other fonts. I'm trying to switch to fontlargenumber.h. It seems that simply switching the references to font5x7 was not sufficient.

    • Great question!

      • First and foremost the 'write()' method can be inherited in a sub-class and changed to anything you like, given the available information (which character to write, and anything in the HyperDisplay base object). That's the most flexible way to implement a custom font, but not the easiest.

      • If you want to use the default 'write()' method you can choose to just provide your own 'getCharInfo()' method. In this case the default 'write()' function will use the information in the char_info_t structure to decide how to show the character. The way it works is that a given character will have numPixels to display. There will be numPixels x and y coordinates to indicate where each pixel should go relative to the character's origin (top left). You can supply a color sequence to use in the pixels, or provide NULL to use the current window's default color sequence. The xDim and yDim members will determine how far to advance the origin for the next character. The 'show' member can be used to decide if a certain character should be shown on screen.

      So in your case check out the current default 'getCharInfo()' function and see how it affects the 'character_info' struct. (Basically it goes over all the pixels in the bitmap and if it exists it adds the location to the xLoc and yLoc arrays). You'll need to loop over the data in the larger font and do a similar thing with it.

      Though it's not exactly the same the inspiration for this method came from the RGB OLED library. You can check out the Custom Font Example for some inspiration and a little more explanation.

      Please show it off when you get it working!

  • there seems to be an error in the code snippet for the buffering example: Setting a pointer (probably in the window struct) to the allocated memory (the buffer) is missing ( setWindowMemory(..) ???)

    • Thanks spotting that! I couldn't find anything in the Buffering Example on GitHub. Is this the right file? Could you suggest a line # or something so I can find it more easily?

      • it should be line 79,80 in the example source you linked. And in the original library source, the signature for the fn appears here: https://github.com/sparkfun/SparkFun_HyperDisplay/blob/00116e434827b70a261ad61d895cd0583bbb611b/src/hyperdisplay.h#L174

        • Okay so I gave it a look-over and still couldn't see the missing pointer setting. In lines 79-80 there are two different functions being called - one sets the memory for the current window and the other requires that you specify which window to set the memory for. That might be able to account for the confusion. If it doesn't and there's still trouble will you consider posting a pull request with your desired changes on GitHub? Or if not that then just an issue with a screenshot of what you're seeing would be good.

          • ohhh, I see where we've mis-communicated. I meant that in the actual tutorial write-up, there is a code snippet called out; In the page here: https://learn.sparkfun.com/tutorials/everything-you-should-know-about-hyperdisplay/buffering ...there is a code-snippet, right below the words "Here's how that process might look in code:" My point was simply that in that excerpt, the actual code for setting the buffer memory is missing. This might be misleading/confusing because the paragraph right above it makes an explicit point about the need to set the buffer memory .The example code itself that you linked is correct (i.e. it uses the right function call) My apologies for not being more clear as to what I perceived the "mistake" to be

  • I love the idea of the "Beerware" license. Also, HyperDisplay looks awesome! Well done!


If you've found a bug or have other constructive feedback for our tutorial authors, please send us your feedback!