TE35 touch events(bad display?)

I’m getting pretty frustrated. I’ve copied several of the “simplest” codes for testing one of the displays and I can’t tell if I just have a bad display or what. I’ve replaced all four cables thinking it would be one of them, but get the same result.

I’ve reduced the code down to this:

SolidColorBrush Red = new SolidColorBrush(Colors.Red);
SolidColorBrush Blue = new SolidColorBrush(Colors.Blue);
bool bLastState=false;
void ProgramStarted()
{
Board_Display.WPFWindow.TouchUp += new Microsoft.SPOT.Input.TouchEventHandler(WPFWindow_TouchUp);
}
void WPFWindow_TouchUp(object sender, Microsoft.SPOT.Input.TouchEventArgs e)
{
if (bLastState)
Board_Display.WPFWindow.Background =Blue;
else
Board_Display.WPFWindow.Background =Red;
bLastState= !bLastState;
}

What happens is I can hit the display, over and over and over and over and over and over and over and over and over…holy crap, it changed colors! hit it over and over and over and over and over holy crap, it changed color, hit it, holy crap it changed color, hit it over and over and over and over and over and over and over and over and over. Completely not what I expect to happen.

I’ve dug through so many example codes, switched to TouchDown rather than TouchUp, put handlers in for both, used SimpleGraphics to change the background color, tried just sending Debug.Print commands, every damned thing and get the same non-result.

My latest crap is tying into TouchCollectorConfiguration on a timer to try and figure out what the fuck is going on.

DispatcherTimer tm;
DateTime FirstStart = DateTime.Now;

    void ProgramStarted()
    {
        tm=new DispatcherTimer(Dispatcher.CurrentDispatcher);
        tm.Interval = new TimeSpan(0,0,0,0,500);
        tm.Tick += new EventHandler(tm_Tick);
        tm.IsEnabled = true;
        tm.Start();
        Board_Display.WPFWindow.Background = new SolidColorBrush(Colors.Yellow);            
    }

    void tm_Tick(object sender, EventArgs e)
    {
        int x=0;
        int y=0;
        TouchCollectorConfiguration.GetLastTouchPoint(ref x,ref y);
        Debug.Print(DateTime.Now.Subtract(FirstStart).Seconds+" x=" + x + " y= " + y);
    }

Here’s a video. http://sdrv.ms/ZnLgHz It’s hard to get everything in the screen at once, but I’m tapping the crap out of the screen and it’s only randomly registering my touches.

Do I have a bad screen? is there something wrong with the code? What should I be looking at? My first experience with Gadgeteer anything started less than a week ago when I ordered these parts.

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)

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)

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)

So apparently the 101010 button at the bottom(in orange) will submit an empty message…sorry…

New video: http://sdrv.ms/14dXZoE


DispatcherTimer tm;
        DateTime FirstStart = DateTime.Now;
        Text text;

        void ProgramStarted()
        {
            #region Prepare window
            Board_Display.WPFWindow.Background = new SolidColorBrush(Colors.Black);
            text = new Text(Resources.GetFont(Resources.FontResources.NinaB), "");
            text.HorizontalAlignment = HorizontalAlignment.Center;
            text.VerticalAlignment = VerticalAlignment.Center;
            text.ForeColor = Colors.Yellow;
            Board_Display.WPFWindow.Child = text;
            #endregion
            #region Timer
            tm = new DispatcherTimer(Dispatcher.CurrentDispatcher);
            tm.Interval = new TimeSpan(0, 0, 0, 0, 250);
            tm.Tick += new EventHandler(tm_Tick);
            tm.IsEnabled = true;
            tm.Start();
            #endregion
        }

        void tm_Tick(object sender, EventArgs e)
        {
            TimeSpan ts = DateTime.Now.Subtract(FirstStart);
            int x = 0,y = 0;            
            TouchCollectorConfiguration.GetLastTouchPoint(ref x, ref y);
            ChangeText(ts.Minutes + ":" + ts.Seconds + " x=" + x + " y= " + y);
        }

        void ChangeText(string message)
        {
            if (Dispatcher.CurrentDispatcher.CheckAccess())
                ChangeTextD(message);
            else
                Dispatcher.CurrentDispatcher.Invoke(new TimeSpan(100), ChangeTextD, message);
        }
        object ChangeTextD(object message)
        {
            text.TextContent = (string)message;
            return null;
        }

@ NXTwoThou -

I took a quick look…

I do not see a GlideTouch.Initialize(); inside ProgramStarted();

I assume that TouchCollectorConfiguration.GetLastTouchPoint(ref x, ref y);
needs it as with other touch events…

I’m mighty confused. First I read that I couldn’t use SimpleGraphics because I couldn’t get touch events.

Then I tried WPF touch events, didn’t work
Then I tried making a loop looking at the TouchCollectorConfiguration
Now your telling me I can’t use SimpleGraphics, nor WPF, and have to learn Glide?

WTF?

@ NXTwoThou - I hope WTF means “what’s the truth”. :frowning:

Sorry, am frustrated, I keep looking for docs and simple code examples but end up having to search through hundreds of forum posts to try and find out anything. My previous experience is with Netdunio Go and found with it for a year before giving up on it(missed deadline after deadline after deadline, then say “oh, it’ll be fixed by this -other- new product, that we should have ready shortly”, still no resolution). The first wave of things I created worked, except that after 15 minutes to a few hours, the display would stop updating/giving back touch responses. The second wave of things(using newer modules that became available) it not working got blamed on the main board not supplying enough power for all the modules(and then say it couldn’t even power half of them was a slap in the face).

Was hoping that Gadgeteer was my answer. I ported my code over in a few hours using SimpleGraphics, but I couldn’t get any touch response, so have taken it simpler and simpler and simpler trying to figure out what’s wrong. All the “simple” examples I’ve been able to find net me the same thing, rare, if any, touch events.

@ NXTwoThou -I looked at your code and then your video, and noticed that you were polling every 250 milliseconds but were tapping the screen a lot faster. Try tapping slowly or poll more often.

I have not done anything recently with touch, so I can’t be sure what you are doing is correct. But I did notice the timing differential.

I’ve tried all sorts of timings on it. You’ll see in the video I keep my finger on it for a few seconds, release, put my finger for a few seconds, release, then try quick tapping. I can’t get any consistency.

Please note, this is after trying to use regular TouchUp/TouchDown events that rarely if ever fired. I’m trying to get a lower level diagnosis.

Just used this code

http://www.ghielectronics.com/community/codeshare/entry/407

Hoping it was some sort of calibration problem. Took me 8 minutes of holding/tapping/looking funny at it to get past calibration, I then have the exact same lack of response.

Is there any way of telling if a display is bad?

We are looking into this and will give you an answer soon

1 Like

Is it related to http://www.ghielectronics.com/community/forum/topic?id=9990&page=3 ?

As a fyi, I tried http://www.tinyclr.com/codeshare/entry/563 and as soon as I try and do a ReadX() it throws an exception, so that’s no help.

Gus, could I get a status report on what you are looking at? I’m dead in the water.

What device are you trying to use with the Touch? Hydra, Spider, Cobra II? There may not be anything wrong with the TE35. There were issues with the Hydra Touch but it has been fixed and is waiting for the next SDK release.

// works on FEZ Spider with TE35
namespace GadgeteerApp1
{
    public partial class Program
    {
        // This method is run when the mainboard is powered up or reset.   
        void ProgramStarted()
        {
            display_TE35.SimpleGraphics.AutoRedraw = true;

            display_TE35.WPFWindow.TouchDown += new Microsoft.SPOT.Input.TouchEventHandler(WPFWindow_TouchDown);
            display_TE35.WPFWindow.TouchUp += new Microsoft.SPOT.Input.TouchEventHandler(WPFWindow_TouchUp);

            display_TE35.WPFWindow.Invalidate();

            Debug.Print("Program Started");
            
        }

        void WPFWindow_TouchUp(object sender, Microsoft.SPOT.Input.TouchEventArgs e)
        {
            display_TE35.SimpleGraphics.DisplayText("(" + e.Touches[0].X + "," + e.Touches[0].Y + ")", Resources.GetFont(Resources.FontResources.NinaB),
                Colors.Green, (uint)e.Touches[0].X, (uint)e.Touches[0].Y);
        }

        void WPFWindow_TouchDown(object sender, Microsoft.SPOT.Input.TouchEventArgs e)
        {
            display_TE35.SimpleGraphics.Clear();

            display_TE35.SimpleGraphics.DisplayText("(" + e.Touches[0].X + "," + e.Touches[0].Y + ")", Resources.GetFont(Resources.FontResources.NinaB),
                Colors.Red, (uint)e.Touches[0].X, (uint)e.Touches[0].Y);
        }
    }
}

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)

;)