static void Main(string[] args) { try { string portName = SerialPortHelper.FindProlificPortName(); using (SSC32Board board = new SSC32Board(portName)) { Servos servos = new Servos(); servos.ConfigureFromFile("ConfigSSC32.cfg"); Servo baseServo = servos.BaseServo; System.Console.WriteLine(baseServo); baseServo.Move(-30, 100, board); baseServo.Move(30, 100, board); } } catch (Exception ex) { System.Console.WriteLine(ex.ToString()); } finally { System.Console.WriteLine("Hit <Enter> to end."); System.Console.ReadLine(); } }
private void EnsureSSC32BoardIsInitialized() { if (m_SSC32Board == null) { string portName = SerialPortHelper.FindProlificPortName(); m_SSC32Board = new SSC32Board(portName); } }
static void Main() { string portName = SerialPortHelper.FindProlificPortName(); using (SSC32Board board = new SSC32Board(portName)) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); MainForm mainForm = new MainForm(); mainForm.Initialize(board); Application.Run(mainForm); } }