Information on Nwazet Display Go! module - Page 2 - Netduino Go - Netduino Forums
   
Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Information on Nwazet Display Go! module


  • Please log in to reply
34 replies to this topic

#21 EricMeyer

EricMeyer

    Advanced Member

  • Members
  • PipPipPip
  • 41 posts
  • LocationAllen, Texas

Posted 27 April 2012 - 05:57 PM

Which specific line did you comment out? I'll gladly update the demo code if I can repro the issue.


The sd.Dispose() was the thing that threw an exception. I was running it within the debugger so it might have been something that would have been caught otherwise.

No problem at all.

-Eric

#22 JerseyTechGuy

JerseyTechGuy

    Advanced Member

  • Members
  • PipPipPip
  • 870 posts

Posted 28 April 2012 - 02:29 AM

Is it possible to design your own fonts? Looking at the fonts in the display project, I can see the descriptor contains two integers representing the address and the width in pixels, but where are the actual bit maps defined? For one of my readouts I'd like to have a large 100-120pt font, maybe even like an old 7 seg display style. I'm just not seeing where the bitmap arrays are.


Anyone have an idea?

#23 carb

carb

    Advanced Member

  • Members
  • PipPipPip
  • 352 posts
  • LocationCrystal River, Florida

Posted 28 April 2012 - 02:45 AM

Anyone have an idea?

Dave, that is most likely a question for Fabien or Bertran to answer. I do know that Fabien said that the installed fonts reside in firmware for the display. I think (not sure) that somewhere I read that other fonts could be downloaded from SD card. If that is the case other fonts should be possible.

Chuck

So you know, I'm not using anything that has to do with Micorsoft.SPOT.Font.
The font definitions in the C# code are only used to track the variables sizes of the characters in each font.
The actual fonts are in the display's firmware. This makes things very efficient for display as the C# code only passes a font ID to reference a given font when needed.

Hope it helps.

-Fabien.


Chuck

#24 Fabien Royer

Fabien Royer

    Advanced Member

  • Members
  • PipPipPip
  • 406 posts
  • LocationRedmond, WA

Posted 28 April 2012 - 05:53 PM

Hi Dave, Carb quoted me correctly: the actual font definitions are embedded in the display module's flash and referenced through an identifier from the C# application for performance reason. Now, there are a couple of ways to solve your need for a large display. The most obvious one would be for you to add your own font(s) to the touch display module firmware and recompile it. You'd also need to reflash the on-board chip using ST's serial flash loader or JTAG. I think this is a bit overkill in your scenario. The next option would be for me to add a custom font upload feature. This method would be ideal and something I'm planning on doing in a future revision, along with a few other features... Trouble is: I have no time to do it now and reflashing modules easily from the Netduino Go! board is not yet supported (I know that Chris is working on it though). In the meantime: if you want to paint a large 7-segment display on the screen, why not just implement a 7-segment digit class in C# doing just that with the drawing commands that are already available to you? Cheers, -Fabien.

#25 JerseyTechGuy

JerseyTechGuy

    Advanced Member

  • Members
  • PipPipPip
  • 870 posts

Posted 28 April 2012 - 06:57 PM

Hi Dave,

Carb quoted me correctly: the actual font definitions are embedded in the display module's flash and referenced through an identifier from the C# application for performance reason.

Now, there are a couple of ways to solve your need for a large display.

The most obvious one would be for you to add your own font(s) to the touch display module firmware and recompile it. You'd also need to reflash the on-board chip using ST's serial flash loader or JTAG. I think this is a bit overkill in your scenario.

The next option would be for me to add a custom font upload feature. This method would be ideal and something I'm planning on doing in a future revision, along with a few other features... Trouble is: I have no time to do it now and reflashing modules easily from the Netduino Go! board is not yet supported (I know that Chris is working on it though).

In the meantime: if you want to paint a large 7-segment display on the screen, why not just implement a 7-segment digit class in C# doing just that with the drawing commands that are already available to you?

Cheers,
-Fabien.


Thanks Fabien. I will likely do what you said last (implement using drawing) for now during prototyping. I'm going to work on converting my other product over to use the NGO and that uses a standard 20x4 LCD, so this gives me some times for everything to catch up for the other project.

#26 LenR

LenR

    New Member

  • Members
  • Pip
  • 8 posts

Posted 08 May 2012 - 11:25 PM

Hi Fabien, I have been looking at your Button Widgets and they will really make creating user interfaces a lot easier. I can't quite figure out how to set up an event handler for one though. Your example looked like it lumped three buttons into one handler. Would you do a little snippet that shows how you would set up event handlers for two buttons that increment two different integers based on which button is pushed? That would really clarify things for me. Thanks, Len I don't know if this is what was intended, but it seems to work. I added to your multitouch example. while (!continueButton.Clicked) { canvas.ActivateWidgets(true); canvas.RenderWidgets(); canvas.Execute(); canvas.TouchscreenWaitForEvent(); if (redButton.Clicked) { redctr = redctr + 1; Debug.Print("RedCounter: " + redctr.ToString()); } if (greenButton.Clicked) { greenctr = greenctr + 1; Debug.Print("GreenCounter: " + greenctr.ToString()); } if (blueButton.Clicked) { bluectr = bluectr + 1; Debug.Print("BlueCounter: " + bluectr.ToString()); } canvas.RenderWidgets(Render.All); canvas.Execute(); }

#27 Fabien Royer

Fabien Royer

    Advanced Member

  • Members
  • PipPipPip
  • 406 posts
  • LocationRedmond, WA

Posted 11 May 2012 - 03:34 PM

Hi Len,

You're re-inventing what the Widget event handler is already doing Posted Image The Widget event handler gives you a reference to the Widget that was clicked when the even fires. If that's not enough for your scenario, you can tag a Widget through the ID property and you can also add / remove handlers to which Widgets click events will be broadcast if you don't want to use the generic one.

I hope this helps.

Cheers,
-Fabien.

#28 LenR

LenR

    New Member

  • Members
  • Pip
  • 8 posts

Posted 16 May 2012 - 08:56 PM

Hi Len,

You're re-inventing what the Widget event handler is already doing Posted Image The Widget event handler gives you a reference to the Widget that was clicked when the even fires. If that's not enough for your scenario, you can tag a Widget through the ID property and you can also add / remove handlers to which Widgets click events will be broadcast if you don't want to use the generic one.

I hope this helps.

Cheers,
-Fabien.


I tried the following code and the widget ID was 0 (zero) no matter what button I pushed. It colors the right button, but for some reason the ID is 0.

public static void ButtonsClickedHandler(VirtualCanvas canvas, Widget widget, TouchEvent touchEvent)
{
widget.Dirty = true;
widget.Draw(canvas);
// canvas.DrawFill(((ButtonWidget)widget).FillColor);
Debug.Print("Widget: " + widget.ID.ToString());
}

#29 Fabien Royer

Fabien Royer

    Advanced Member

  • Members
  • PipPipPip
  • 406 posts
  • LocationRedmond, WA

Posted 16 May 2012 - 09:04 PM

You need to assign your own Widget ID :)

#30 LenR

LenR

    New Member

  • Members
  • Pip
  • 8 posts

Posted 17 May 2012 - 03:43 PM

You need to assign your own Widget ID :)



I think it is getting close, but I have a problem. I have two threads running, one that samples temperature every second and
writes it to the canvas, the other waits for buttons to be touched and increments a value (setpoint) and writes it to the canvas.
The string writes to the canvas do not show up unless a button is pushed. I tried to get around this by putting in a "canvas.execute()".
If I put in a "canvas.execute()" in the temperature sampling loop it causes the program to hang until a touch is registered on
the canvas at which point an endless bunch of touches are detected even though there was only one. The two code blocks are below:

 static void MainLoop()
        {
            while (running)
            {
                Thread.Sleep(1000);
                now = DateTime.Now.Ticks;
                t1 = new DateTime(now);
                t2 = new SystemTime();
                _colorValues[_colorIndex] = (byte)(255 * _potentiometer.GetValue());
                UpdateLedColor();

                canvas.DrawRectangleFilled(50, 25, 120, 60, (ushort)BasicColor.White);
                canvas.DrawString(50, 30, (ushort)BasicColor.Black, VerdanaBold14.ID, _thermometer.Read().ToString().Substring(0,5));
        //        canvas.Execute();

                Debug.Print("Temp: " + _thermometer.Read().ToString().Substring(0,5));      
                Debug.Print("Light: " + _lightsensor.Read().ToString());
                Debug.Print("Time: " + t1.ToString());
                Debug.Print("UpSp: " + UpSp.ToString());
                Debug.Print("LSp: " + LSp.ToString());
                Debug.Print("Tick: " + tick.ToString());
                
            }
            canvas.Reboot();
            Thread.Sleep(1000);
            canvas.Dispose();
        }

        static void ButtonLoop()
        {
            while (running)
            {
                canvas.ActivateWidgets(true);
                canvas.RenderWidgets();
                canvas.Execute();

                canvas.TouchscreenWaitForEvent();

                canvas.RenderWidgets(Render.All);
                canvas.Execute();
                tick = tick + 1;
            }
        }

I have not been able to figure out how to write strings to the canvas and get them to show up. The buttons seem to work ok, unless I put a canvas.execute() in the
temperature sampling loop.

#31 Fabien Royer

Fabien Royer

    Advanced Member

  • Members
  • PipPipPip
  • 406 posts
  • LocationRedmond, WA

Posted 17 May 2012 - 04:36 PM

This is expected and I released a firmware update for the display that allows to scan for touch events w/o blocking earlier this week.
Please see this thread: http://forums.netdui...-announcements/

Cheers.
-Fabien.

#32 neslekkim

neslekkim

    Advanced Member

  • Members
  • PipPipPip
  • 350 posts
  • LocationOslo, Norway

Posted 20 May 2012 - 04:47 PM

Hi Steve,

There isn't one in this revision of the module and here's why: the ILI9341 IC driver of the display I'm using does have a PWM backlight control circuit that is configurable through software commands (Write Display Brightness (51h) page 141 of the datasheet). The manufacturer of the display omitted to connect it to the backlight Posted Image I discovered this when the module board was already in production as I was focusing on the finishing touches of the driver. At that point, it was too late to change the design. The display manufacturer recognized the omission and did say that they would correct the mistake in a future revision of the display.


Are there going to be an update on the displaymodule to enable brightness control? is so, will the productpage be updated when so happens?
I'm holding off purchase of the display for now..

--
Asbjørn


#33 Fabien Royer

Fabien Royer

    Advanced Member

  • Members
  • PipPipPip
  • 406 posts
  • LocationRedmond, WA

Posted 21 May 2012 - 03:47 PM

Hi neslekkim, Brightness control can only be achieved with a hardware change, not a firmware change unfortunately. Cheers, -Fabien.

#34 neslekkim

neslekkim

    Advanced Member

  • Members
  • PipPipPip
  • 350 posts
  • LocationOslo, Norway

Posted 21 May 2012 - 03:49 PM

Its that hardware change I was wondering about, if the hardware is going to be changed in the future to make it work. I guess it's not something one can fix ourself?

--
Asbjørn


#35 Fabien Royer

Fabien Royer

    Advanced Member

  • Members
  • PipPipPip
  • 406 posts
  • LocationRedmond, WA

Posted 21 May 2012 - 04:33 PM

The time for a hardware update will happen when we have exhausted our existing stock and at the moment, I have no idea when that's going to happen. As far as doing it yourself goes: I would not recommend modifying the touch display board unless you really know what you're doing.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.