Trying to use SSC 32 with C #
Hello everyone, I am building a robot and I have connected my 2x12 saber to my SSC32 and I am trying to send commands for the movements of the motors from a WindowsForms application, I am trying in many ways but it does not work. I hope someone can help me, I leave here the code that I am using. Thanks.
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;
using System.IO.Ports;
namespace WindowsFormsApp2
{
public partial class Form1 : Form
{
SerialPort port = new SerialPort();
public Form1()
{
InitializeComponent();
port.BaudRate = 115200;
port.PortName = "COM6";
port.Parity = Parity.None;
port.DataBits = 8;
port.StopBits = StopBits.One;
port.Open();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
port.WriteLine("#1 P1800 T500 <cr>");
}
}
}
1 Like
@Daviron28zgz Welcome to the RobotShop Community.
-
Can you confirm that you removed the center red wire from the Sabertooth’s two RC connectors? These PROVIDE VS (servo voltage) which would conflict with the SSC-32U’s 5V rail
-
You can replace with \r and you don’t need the spaced between each.
-
Would need to give it some thought, but try without the T (time) modifier command, so just #1P1800\r
-
The SSC-32U’s default baud rate is not 115200, it’s 9600. You need to change the baud rate physically to 115200. See page 34:
http://www.lynxmotion.com/images/data/lynxmotion_ssc-32u_usb_user_guide.pdf
-
This of course assumes you have a proper battery connected to the Sabertooth, as well as motor(s), and that the RC connectors go to the right pins on the SSC-32U in the right orientation.
1 Like
Hey @Daviron28zgz,
Welcome to the RobotShop community!
You may want to check the example found here. While it is in VB.NET (and not C#), both languages are equivalents in .NET and thus you can use any of the online converters (or maybe even in VS directly) to convert the VB.NET into C# code.
That being said, the example is pretty straight forward and should give you a good starting point.
Sincerely,
Thanks¡¡¡ but I think that today it has burned my Sabertooth 2x12…
wow…too much things i didn´t know…thanks¡¡
The SSC-32U would not have burned the Sabertooth (it should only be sending commands). The issue might be the conflict in powering VS and the Sabertooth’s 5V output.
2 Likes