duminică, 6 ianuarie 2013

C# communicate with Arduino Part.2





I tried to command a servo, via usb, from C # application to an Arduino.



When you pull the slider bar, the value is sent to the Arduino, which represent the positions of the servo.




C# code:

using System.Text;
using System.Windows.Forms;
using System.IO.Ports;

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

        private void bara_ValueChanged(object sender, EventArgs e)
        {
           

[ do you want the rest of the code???? ]


        private void Form1_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (serialPort1.IsOpen) serialPort1.Close();
        }
    }
}

 

3 comentarii:

  1. Hi, Can I get the full C# code for my project please?

    My email : mateusz.szymonski@gmail.com

    RăspundețiȘtergere
  2. Hello, Can you send me the full C# code?
    I really need it for my project. Thanks a lot!
    My email is lawgeebye@gmail.com

    RăspundețiȘtergere
  3. Hello, Can you send me the full C# code please?
    I really need it for my project. Thanks a lot!
    my email is lawgeebye@gmail.com

    RăspundețiȘtergere