Sunday, 22 November 2015

Make computer application to control led on Arduino Uno

In order to control led of  Arduino Uno we need computer application. For that, we need Microsft Visual Studio. I am using Visual Studio 2012. I already had written the source code for it.

Source code is below:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Arduino
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            arduino.Open();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            arduino.Write("9");
        }

        private void button2_Click(object sender, EventArgs e)
        {
            arduino.Write("3");
        }

        private void button4_Click(object sender, EventArgs e)
        {
            arduino.Close();
            this.Close();
        }

        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {

        }
    }
}

Below is design:





UI of computer application
 Changing COM PORT:

 
UI of computer application

After this, upload the arduino program on to your board.



All the files can be downloaded from here:
https://drive.google.com/file/d/0B4Px6Drl6Zz_LWFUcDd2QzBCQWM/view?usp=sharing