Use of 16x2 Character display on Cobra II

Hi, i ve to connect and use 16x2 display on Cobra II (Eco)
The firsd question is: how to connect display to mainboard ? (What port ?)
The second is:
I don’t find any code help me !
In tutorial there is a bad link

I found:

 Bitmap LCD = new Bitmap(SystemMetrics.ScreenWidth,SystemMetrics.ScreenHeight);
            //clears the memory and not the display
            LCD.Clear();
            int i;
            for (i = 10; i < 200; i += 4)
            {
                //draw on memory
                LCD.DrawLine(Colors.Green, 1, 10, i, i, 200);
            }
            //transfer the bitmap memory to the actual display
            LCD.Flush();

But it’s not for 16x2 display (it works fine on emulator)

I fount this:

using GHIElectronics.NETMF.FEZ;
namespace MFConsoleApplication1
{
public class Program
{
public static void Main()
{
FEZ_Components.SerialLCD LCD =
new FEZ_Components.SerialLCD(FEZ_Pin.Digital.Di5);
LCD.ClearScreen();
LCD.CursorHome();
LCD.Print("FEZ Rocks!");
}
}
}

But i suppose that it work only with previous version of system (i’ve not found namespace !)

Where can I found any documentation for writing text over 16x2 display in c# for cobra II ?

Thank you in advance !

Lorenzo

You need to use the Display_HD44780 on any Y socket.
it is not a lcd and only displays text.
Here is the tut for it

Using code tags will make your post more readable. This can be done in two ways:[ol]
Click the “101010” icon and paste your code between the

 tags or...
Select the code within your post and click the "101010" icon.[/ol]
(Generated by QuickReply)

Thank you for reply my post.
I’ve some problems: I read tutorial but i can’t reference the display.

            // Clears the screen
            display_HD44780.Clear();

            // Prints "_____ World" to the top left of the display
            display_HD44780.PrintString("_____ World!");

            // Places the cursor back at the top left of the screen
            display_HD44780.CursorHome();

The question is: "Which type is display_HD44780 ?"
In my opinion the template is incomplete because some parts are missing.
In my simple test app i use following namespaces:

using System;
using Microsoft.SPOT;
using Microsoft.SPOT.Cryptoki;
using Microsoft.SPOT.Hardware;
using Microsoft.SPOT.Ink;
using Microsoft.SPOT.Input;
using Microsoft.SPOT.IO;
using Microsoft.SPOT.Messaging;
using Microsoft.SPOT.MFUpdate;
using Microsoft.SPOT.Net;
using Microsoft.SPOT.Presentation;
using Microsoft.SPOT.Time;
using Microsoft.SPOT.Touch;
using Microsoft.SPOT.Hardware.UsbClient;
using Microsoft.SPOT.Presentation.Controls;
using Microsoft.SPOT.Presentation.Media;
using Microsoft.SPOT.Presentation.Shapes;
using GHIElectronics.Gadgeteer;
using GHIElectronics;
using GHI.Premium.Hardware;
using GHI.Premium.IO;
using GHI.Premium.Native;
using GHI.Premium.System;
using GHI.Premium.USBClient;
using GHI.Premium.USBHost;

namespace MicroFrameworktest
{
    public class Program
    {
        public static void Main()
        {
            Debug.Print("Amazing!");


// TODO to handle display !

        }

    }
}

Is there a more complete tutorial ?
I found some code but i think it’s ok for previous framework…

Thank you.

Did you buy the display from GHI?

The HD44780 is the controller board used to run the 16 x 2 display (its the circuit board you get attached to the lcd itself. When the code is generated for you it created an LCD control with the name “display_HD44780”.

Try this (although it is off the top of my head as I dont have gadgeteer installed here at work)

  1. Plug in your LCD display to socket 1 on the device. (Unplug any power before doing this)

  2. In C# create a new Gadgeteer project and open the gadgeteer interface, ensure you have a Cobra II board in the main display. If not add it and replace current board

  3. Add a HD44780 display to your project from the toolbar. Connect it to socket one on the diagram.

  4. Open program.cs. In the startup function type

this.display_HD44780.Clear;
this.display_HD44780.PrintString(“Hello World”);

When you type “this.” you should get some context help that will help you find your displays name, it may have a slightly different name to the one I have written above.

  1. Plug in the USB cable and run your project. With luck it should start up and say hello world.

From then on you can access all the properties of the device though “this.display_HD44780.”

I hope that helps :o)

Paul

Yes, i’ve make an order for Cobra II, 3x4 Keyboard and 16x2 display throw my company partner. I’ve not received yet, but i need to know in advance how it work.
Thank you. I’ve read some documentation, but i don’t know existence of “Gadgeteer project”. It’s great !
I just add Cobra II (replacing default mainboard) and display HD44780, connecting it to lcd port 1.
Now in program.cs i add

this.display_HD44780.Clear();
 this.display_HD44780.PrintString("Hello World");

and code compiles fine.
I can’t test it (because the emultator doesn’t work with display) but i hope it works fine with mainboard.
My mistake is to add a “Micro Framework” project and not a “Gadgeteer” one… I immagine that I have to use “Gadgeteer” project for writing my “complete” application too.
Your post is very helpful for me ! Thanks u a lot !!!
My next step will be plug Cobra II, deploy code on it.

Glad I could help, let me know how it goes :o)

Paul