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.