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.

  • Member #1599254 / about 4 years ago / 1

    Hi, I'm new to using hyper display, and was wondering if there was any resources on rotating the text. would swapping the x and y values do the trick or would i have to go into more detail with the code? thank you so much!

    • Liquid Soulder / about 4 years ago / 1

      Hi - as it stands you would need to go into more detail in the code. You could make your own class that inherits from one of the existing classes and has more advanced text functions. We are still open to suggestions about how to improve font / text support in HyperDisplay, bit we are searching for an extensible + general answer. So in the meantime a simple inherit will be best for you

  • Member #1555331 / about 4 years ago / 1

    Hi. I was wondering if there might be any resources anywhere on using the library to display text? I am planning on using the transparent display for a project but am unsure where to start with displaying text. I see some comments talking about fonts and font sizes so I do imagine it is possible. Would anybody be able to point me in the right direction to get started with this? Thanks.

    • Liquid Soulder / about 4 years ago / 1

      Sorry this is not well documented - text is for the most part designed to be handled in the layer just above HyperDisplay (e.g. by calling the drawing functions to generate characters). Thankfully, though, my friend insisted that HD include a default font. So it should suffice to use myTOLED.print(string) to show text. You can use myTOLED.setTextCursor(x0, y0) to position the top-left corner of the next character in pixel units. myTOLED.resetTextCursor() will place the next character at the default location (which is (0,0) for most displays)

      • Member #1555331 / about 4 years ago / 1

        Hey thanks for this. Also, you wouldn't know if there is a way to rotate the text as well so I could say use it in a portrait or landscape configuration?

        • Liquid Soulder / about 4 years ago / 1

          That functionality is not built-in, but you could add it yourself relatively easily. https://github.com/sparkfun/SparkFun_HyperDisplay/issues/2

  • IanChristensen / about 5 years ago * / 1

    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

  • Alwyn Smith / about 5 years ago / 1

    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.

    • Liquid Soulder / about 5 years ago / 1

      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!

  • technomax / about 5 years ago / 1

    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(..) ???)

    • Liquid Soulder / about 5 years ago / 1

      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?

      • technomax / about 5 years ago * / 1

        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

        • Liquid Soulder / about 5 years ago / 1

          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.

          • technomax / about 5 years ago / 1

            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

            • Liquid Soulder / about 5 years ago / 1

              Aha! Thanks for explaining, I see now. I'll go over and fix that snippet :)

  • Jon Self / about 5 years ago / 1

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


If you've found an issue with this tutorial content, please send us your feedback!