Fez Cerberus & Display N18

@ thisway.ro - Unfortunately it is a private member of the display driver:

http://gadgeteer.codeplex.com/SourceControl/latest#Main/Modules/GHIElectronics/Display N18/Software/Display N18/Display_N18_42/Display_N18_42.cs

You have two options:

  1. Take the driver code an use it directly instead of the module assembly that is installed on your PC. This way you can modify the code and make the member public

or

  1. Just duplicate the SPIConfig object and use it in the Util method

can you please provide further information as how to do either of the 2 proposed solutions ?

I’ve tried reverse engineering the code in the driver and making the call from my program by all i got was a blank screen …

thanks

the driver option seems more interesting and could open the code to more customization :smiley: for example i would like to turn of back light after initialization etc

  1. Remove module from your design view and delete the reference to “GTM.GHIElectronics.Display_N18”

  2. Take Display_N18_42.cs from codeplex and add it to your project

  3. Change Display_N18_42.cs:

from

private SPI.Configuration netMFSpiConfig;

to

public SPI.Configuration netMFSpiConfig;
  1. In you Program.cs

declare:

private Gadgeteer.Modules.GHIElectronics.Display_N18 display_N18;

as a class variable

in ProgramStarted initialize the instance and connect it to whatever socket it was connected before (for example socket 6):

this.display_N18 = new GTM.GHIElectronics.Display_N18(6);

Now you should be able to use

display_N18.netMFSpiConfig 

in the Util class method.

all fine except this

The type or namespace name ‘SPI’ does not exist in the namespace ‘Gadgeteer.Interfaces’ (are you missing an assembly reference?)

tried locating it but no luck

thanks for the help

i have this allready

using GTI = Gadgeteer.Interfaces;

i don’t find any assembly with SPI …

Again

“using” statement is not equal to adding a reference.

You need to add a reference to Gadgeteer.SPI.dll

yes, that part i got it :slight_smile: the problem was that i expected to find the assembly in GHI and it was in the Microsoft files :slight_smile:

Even so, the display orientation did not change …

This is the code:


        void ProgramStarted()
        {
            display_N18.SimpleGraphics.BackgroundColor = Colors.Yellow;

            Util.SetSpecialDisplayConfig(display_N18.netMFSpiConfig, Util.BPP_Type.BPP16_BGR_BE, 2);
            
            Bitmap text = new Bitmap(64, 20);

            text.DrawText("Cerberus", Resources.GetFont(Resources.FontResources.small), Colors.Yellow, 5, 5);
            
            display_N18.Draw(text);            
        }

And this is the result:

http://sdrv.ms/1bgBAXo

Did anyone get this working ? I tried multiple orientations without success …

That function does not work with individual bitmaps. It will only draw an image when you call flush on a bitmap that is the size of the screen. For example, if you call SetSpecialDisplayConfig with a 90 degree rotation, you would have to create a bitmap that is 160x128. When you call flush on that object, its contents are drawn to the screen. You would want to draw the smaller bitmaps you create into that large 160x128 bitmap. You will not need to call display_N18.Draw.