C#.NET Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void trackBar1_Scroll(object sender, EventArgs e)
{
serialPort1.Write(trackBar1.Value + "s");
}
private void Form1_Load(object sender, EventArgs e)
{
serialPort1.Open();
serialPort1.Write("0s");
}
}
}
Thanks, I have tried to copy and paste the code to Visual studio & then added the Serial port tool and set It to COM4 as well as added a slider, and the error I got did mention "Projects\Slider\obj\Debug\Slider.dll' doesn't contain any UserControl types" this, so does that mean that there is a way to fix this, or is the control type unique to the user that designed the app?
Hi
I have tried to do this, bit I suck at c#.
I will continue to look around for some source code like the c# code above, but with 2 servo support.
Thanks anyway.
Why don't you let arduino deal with the servo controlling issue and just use C# to tell arduino what do to? I don't really know what you want to do but lets say that you are controlling the servo (s) with arduino, then you can create a C# that communicates with Arduino thru serial. As you are trying to use the track bar, you can just send to arduino the trackBarName.Value (int) and move the servo at your will with that value.