1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
| static void Door()
{
try
{
Cpu.Pin inputPin = Meridian.Pins.GPIO8; //Read the switcher on GPIO8
/* ====> Cette ligne cause une erreur */
inputPort = new InputPort(inputPin, true, Port.ResistorMode.PullUp);// switcher "ON" state
}
catch(SystemException)
{
Debug.Print("Etat De La Porte : " );
}
finally
{
Debug.Print(Resources.GetString(Resources.StringResources.String1));
Bitmap img3 = Resources.GetBitmap(Resources.BitmapResources.dooropen);
Bitmap img4 = Resources.GetBitmap(Resources.BitmapResources.doorclose);
Bitmap img5 = Resources.GetBitmap(Resources.BitmapResources.info);
//while (true)
//{
// Toggle on inputport
if (inputPort.Read() == false)
{
DrawHouseCheck2(img4, img5);
doorstate = true;
Debug.Print("Etat De La Porte : " + inputPort.Read().ToString());
}
else
{
DrawHouseCheck2(img3, img5);
doorstate = false;
Debug.Print("Etat De La Porte : " + inputPort.Read().ToString());
}
// break;
//}
}
} |
Partager