I have the SDK source code downloaded, but I cannot find the code for Util.
Specifically, I am trying to look at the code for Util.SetSpecialDisplayConfig(
to see how it works and why I cannot get it to work.
I have the Cerb with the N18. I can Rotate the display but it cuts off a section of the display and wraps around even though it has more screen. It work if I just want to invert the display. If I send the raw commands to the display I can get it to write the image upsidedown or normally but if I try to rotate the display 90deg the screen remains black.
Also, why is is so hard just to rotate the display?
Look at the photo I posted. Anyhow, OSHW part of the library name stands for Open Source HardWare… I think. If they won’t share the source how can it be called open source?
As for “OSHW!=OSSW” That’s the dumbest thing I’ve heard in a while. What’s open about it if the source is closed? Who hears “open source” and thinks proprietary source code?
Anyways that image shows the issue the display is cropped. There are 3 draw commands on that picture using the n18 simplegraphics. Draw gray rect. Text over. Blue text. The gray react should span the display. Instead it is wrapped at the width…
The code for LCD_SetSpecialConfig is device specific, so the actual implementation of the function is in the board specific code. Using Find In Files, I found two occurrences of LCD_SetSpecialConfig one in the STM32F4 port and the other in the AT91 port.
was clearly what I was looking for. I don’t see any reason, however, the device would draw the correct orient, draw 3/4 way down the screen, then stop, go to the start of the lcd and draw the remainder of the screen. Also, I am guessing to play with this code you would have to compile the firmware and then download that. It seems all beyond what I am capable of doing…
Can anyone at GHI just plug in a Cerb+N18 and rotate the display 90 deg clockwise for a horizontal display?
Here’s the perfect opportunity to show a code snippet and picture of what occurs (and a description of what you expect to occur) so anyone can test the same for you…
The example there explicitly shows a way to handle a bitmap. I think the approach you’re going to need to take is to render your text onto a bitmap and then display it, I don’t think the other methods will work explicitly with text onto a rotated bitmap. Someone from GHI might be able to show some demo code for that?
It doesn’t show how to rotate the bitmap. In fact, it doesn’t show you how to rotate the screen. There is just some vague mention of Util.SetSpecialDisplayConfig. Which you do not have access to the first parameter unless you get the n18 code. Then it doesn’t work. Or at least I cannot get it to.
Besides, I am using a display_N18.SimpleGraphics.Draw* functions. All these functions do are wrap the bitmap library draw functions to a class instance of “bitmap” and then automatically draw the bitmap to the screen. AKA the same thing you just recommended that I do.
Again people, I AM LOOKING TO DISPLAY TEXT SIDEWAYS.
If you are not going to talk about how to do that - please do not litter my thread.
Think N18 display in LANDSCAPE mode. That means that the display is wider than it is tall. It would also help if you bothered following the already littered thread and LOOKED at the image I posted of where I am. It is drawing in landscape mode but AGAIN for some unknown reason while it is rendering the image 3/4 of the way rendering the screen is stops and starts at the beginning and renders over the top of another area.
So if I printf(“A Big Message!!!”); The display would show:
What is also disconcerting is the approach they took drawing the display.
The display is actually this one:
which has all it’s source here:
which include examples on how to rotate the display using hardware…
[line] #define MADCTL_MY 0x80 #define MADCTL_MX 0x40 #define MADCTL_MV 0x20 #define MADCTL_ML 0x10 #define MADCTL_RGB 0x00 #define MADCTL_BGR 0x08 #define MADCTL_MH 0x04
When I said it shows how to handle a bitmap, I meant in small pieces. Memory is tight, bitmaps are large, it’s a Cerb… but yes, it does not try to rotate it.
I totally agree with you, a simple example of using the rotation the way GHI envisaged it would be great.
Sorry if you think I’m littering your thread. Leaving you to it now.
Well, I guess I am not smart enough to figure out how to rotate it in pieces. It does have room for 1 bitmap the size of the display. Like it said, the simplegraphics.draw* commands use a class with a class variable of bitmap the size of the display. Unfortunately to rotate a image, you need 2 bitmaps.
Well, if you read my last post, you will see the device itself support rotation commands. All you have to do is have the width and height correct. You can also see in the code, that on landscape they set the width to the height & vv.
Well, I dunno if you really did anything. It was already littered. It just get frustrating when it seems like people are telling you stuff you already know.
If you look at the video, you can clearly see i have had success rotating the image. just not displaying it…
The next SDK will also have improved functionality around writing to the display over SPI when rotated. It no longer flushes the bytes in pieces, though it still does if flushing partial images.