Bonjour, je suis en terminale STI2D et j'ai un programme à faire, j'ai utiliser un programme déjà fait de microsoft pour allumer une led grâce à un bouton et je l'ai modifié. Malheureusement, le programme fonctionnait très bien, même après des modifications, puis je ne sais pas ce qu'il s'est passé, maintenant il ne fonctionne plus du tout, j'ai toujours la même erreur qui m'empêche de le faire fonctionner :
Nom : programmebeug.jpg
Affichages : 138
Taille : 266,3 Ko Voici le message d'erreur que ça m'affiche, qui apparemment vient de la ligne qui est surligné.

Voici mon code :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
using System;
using Windows.Devices.Gpio;
using Windows.UI.Core;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media;


// Pour plus d'informations sur le modèle d'élément Page vierge, consultez la page http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409

namespace premier
{
    /// <summary>
    /// Une page vide peut être utilisée seule ou constituer une page de destination au sein d'un frame.
    /// </summary>
    public sealed partial class MainPage : Page
    {
        public MainPage()
        {
           InitializeComponent();
            InitGPIO();
        }

        private void InitGPIO()
        {
            var gpio = GpioController.GetDefault();

            touchPin = gpio.OpenPin(TOUCH_PIN);

            if (touchPin.IsDriveModeSupported(GpioPinDriveMode.InputPullUp))
                touchPin.SetDriveMode(GpioPinDriveMode.InputPullUp);
            else
                touchPin.SetDriveMode(GpioPinDriveMode.Input);

            touchPin.DebounceTimeout = TimeSpan.FromMilliseconds(50);

            touchPin.ValueChanged += TouchPin_ValueChanged;

        }

        private void TouchPin_ValueChanged(GpioPin sender, GpioPinValueChangedEventArgs e)
        {
            var task = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => {
                if (e.Edge == GpioPinEdge.FallingEdge)
                {
                    rectangle1.Stroke = yellowBrush;
                }

            });
        }

        private const int TOUCH_PIN = 5;
        private GpioPin touchPin;
      //  private GpioPinValue touchPinValue = GpioPinValue.Low;
        private SolidColorBrush yellowBrush = new SolidColorBrush(Windows.UI.Colors.Yellow);
        private SolidColorBrush orangeBrush = new SolidColorBrush(Windows.UI.Colors.Orange);
    }
    

}
J'aimerais savoir si vous auriez une idée pour régler ce problème ? Il m'empêche de continuer mon projet, et je dois le finir rapidement...

merci d'avance.