Update with firmware v4.2.9.1 + 4.2.9.0 tinybooter
This is simple button Glide program that I try to run.
using System;
using System.Collections;
using System.Threading;
using System.IO;
using System.IO.Ports;
using Microsoft.SPOT;
using Microsoft.SPOT.Touch;
using GT = Gadgeteer;
using GTM = Gadgeteer.Modules;
using Gadgeteer.Networking;
using Gadgeteer.Modules.GHIElectronics;
using GHIElectronics.NETMF.Glide;
using GHIElectronics.NETMF.Glide.Display;
using GHIElectronics.NETMF.Glide.UI;
namespace GlideButtonDemo
{
public partial class Program
{
static Window window;
void ProgramStarted()
{
Mainboard.SetDebugLED(true);
// Do one-time tasks here
Debug.Print("Program Started");
GlideTouch.Initialize();
display_CP7.ScreenPressed += new Display_CP7.TouchEventHandler(display_CP7_ScreenPressed);
// Load the Window XML string.
window = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.Window1));
// Resize any loaded Window to the LCD's size.
Glide.FitToScreen = true;
// Assign the Window to MainWindow; rendering it to the LCD.
Glide.MainWindow = window;
// Get the Buttons
Button buttonRed = (Button)window.GetChildByName("buttonRed");
Button buttonGreen = (Button)window.GetChildByName("buttonGreen");
Button buttonBlue = (Button)window.GetChildByName("buttonBlue");
// Set up event handlers
buttonRed.PressEvent += new OnPress(buttonRed_TapEvent);
buttonGreen.PressEvent += new OnPress(buttonGreen_TapEvent);
buttonBlue.PressEvent += new OnPress(buttonBlue_TapEvent);
}
void buttonBlue_TapEvent(object sender)
{
Mainboard.SetDebugLED(false);
Debug.Print("yes1");//led.TurnBlue();
}
void buttonGreen_TapEvent(object sender)
{
Debug.Print("yes2");//led.TurnGreen();
}
void buttonRed_TapEvent(object sender)
{
Debug.Print("yes3");//led.TurnRed();
}
static int lastX = 0;
static int lastY = 0;
static int x;
static int y;
static bool isTouched = false;
void display_CP7_ScreenPressed(Display_CP7 sender, Display_CP7.TouchStatus touchStatus)
{
GHIElectronics.NETMF.Glide.Geom.Point touches;
if (touchStatus.numTouches > 0)
{
touches.X = touchStatus.touchPos[0].xPos;
touches.Y = touchStatus.touchPos[0].yPos;
x = 0;
y = 0;
if (isTouched == false)
{
GlideTouch.RaiseTouchDownEvent(null, new TouchEventArgs(touches));
lastX = x;
lastY = y;
isTouched = true;
}
else
{
if (lastX != touches.X && lastY != touches.Y)
{
touches.X = lastX;
touches.Y = lastY;
GlideTouch.RaiseTouchUpEvent(null, new TouchEventArgs(touches));
isTouched = false;
}
}
}
else
{
if (isTouched == true)
{
touches.X = lastX;
touches.Y = lastY;
GlideTouch.RaiseTouchUpEvent(null, new TouchEventArgs(touches));
isTouched = false;
}
}
}
}
}
The debug is successful but whenever I touch the screen, it shows “Failed to perform I2C transaction”.
Does anyone has this issue when using Glide?