I wrote this simple software in the last week to control a 6DOF robot arm I ordered from china three weeks ago
I tried it on a simple pan tilt mechanism and it is working
Waiting the Chinese robot arm for full trial
Suggestions to improve it are highly appreciated
thanks
What software would that be ?
A print screen of it is attached with full details
it controls a robot arm from the PC...record the sequence .....then play it either once or indefinitely
I see a screen shot, but no details
Does the software communicate with an Arduino and if so, how ?
Of course ...through serial communication
the software checks to which port the arduino is connected....then the user opens the port and uses the scroll bars to send desired positions to each servo....save that sequence...then play it
Are you going to share the code that is running on the Arduino, the type of Arduino that you are using and details of how the Arduino and servos are powered ?
As for the screen shot, do you not think that it would be helpful to label the servo controls with names indicating their function rather than just numbers ?
Good idea...thanks
Once completely tested...I will share all details
I am waiting for the arm parts and writing the error handling codes
I think it's quite cool.
I would place the buttons for connect (I assume it's a button) and close next to each other and at the right of the com post selection.
You can do a detection of the COM ports and make a drop-down.
Out of curiosity, which language did you use?
Ok...thanks
There is a detection of the COM ports called "Check Opened Ports"
Ok...thanks
There is a detection of the COM ports called "Check Opened Ports"
I did it differently in software that I'm working on
The disconnect / close button also worked as a refresh for the list of ports. But that was my approach
Do you cater for the situation where multiple Arduinos are connected and the user has to choose one?
no I did not
Let's see yours if you don't mind
C# code
/// <summary>
/// populate ports combobox
/// </summary>
/// <returns>false on error, else true</returns>
bool PopulatePorts()
{
// clear the combobox
while (cmbPorts.Items.Count != 0)
{
cmbPorts.Items.RemoveAt(0);
}
try
{
List<string> lstPorts = SerialPort.GetPortNames().ToList<string>();
lstPorts.Sort();
foreach (string p in lstPorts)
{
// ignorePorts from App.Config
if (ignorePorts.Contains(p) == false)
{
cmbPorts.Items.Add(p);
}
}
if (cmbPorts.Items.Count == 0)
{
cmbPorts.SelectedIndex = -1;
}
else
{
cmbPorts.SelectedIndex = selectedPort;
}
}
catch (Exception ex)
{
string msg = string.Format(ex.Message);
MessageBox.Show(msg, "Error retrieving ports", MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
return true;
}
It's called when the user closes the connection using the Disconnect button as well as when the form loads.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.