using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Digi.Drivers;

namespace MyApp
{
    public partial class Form1 : Form
    {
        GPIO Input1 = new GPIOiMX51(GPIOiMX51.Port.Port1, 2, GPIO.DirectionValue.Input);
        GPIO Output1 = new GPIOiMX51(GPIOiMX51.Port.Port1, 3, GPIO.DirectionValue.Output, GPIO.IoValue.Low);

        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Button1 value: " + Input1.Value.ToString());
        }

        private void button2_Click(object sender, EventArgs e)
        {
            if (Output1.Value == GPIO.IoValue.Low)
                Output1.Value = GPIO.IoValue.High;
            else
                Output1.Value = GPIO.IoValue.Low;
        }
    }
}