Robofun 機器人論壇

 找回密碼
 申請會員
搜索
熱搜: 活動 交友 discuz
查看: 7369|回復: 7
打印 上一主題 下一主題

如何將控制指令傳入SSC-32

[複製鏈接]
跳轉到指定樓層
1#
發表於 2009-10-21 14:33:09 | 顯示全部樓層 回帖獎勵 |倒序瀏覽 |閱讀模式
現在知道SSC-32的一些控制指令,但是不知道如何將指令傳到SSC-32
2#
 樓主| 發表於 2009-10-26 23:44:55 | 顯示全部樓層
請問vegewell:

我將您的程式語言不多不少、一字不漏的寫在編輯器上,但是在

第一行的Form1、第16和第32行的void 出現如下的錯誤描述:

必須是類別、委派、列舉、介面或結構

該如何修改?

另外,您說的 button1 是指哪個按鍵?

註:我用的是 Microsoft Visual C# 2008 Express 版
3#
 樓主| 發表於 2009-11-17 19:37:38 | 顯示全部樓層
我寫成

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO.Ports;

namespace ConsoleApplication1
{
    class Program
    {
        System.IO.Ports.SerialPort serialPort = new SerialPort();


        public void Form1()
        {
            InitializeComponent();
            if (serialPort.IsOpen)
            {
                serialPort.Close();
            }
            // Configure our serial port *** You'll likely need to change these for your config! ***
            serialPort.PortName = "COM1";
            serialPort.BaudRate = 115200;
            serialPort.Parity = System.IO.Ports.Parity.None;
            serialPort.DataBits = 8;
            serialPort.StopBits = System.IO.Ports.StopBits.One;
        }

        private void InitializeComponent()
        {
            throw new NotImplementedException();
        }


private void button1_Click(object sender, EventArgs e)
        {
          serialPort.Write("#1 P1450\r");
        }
        }
    }

出現錯誤:未包含適合做為進入點的靜態'Main'方法

請問如何修改?
您需要登錄後才可以回帖 登錄 | 申請會員

本版積分規則

小黑屋|手機版|Archiver|機器人論壇 from 2005.07

GMT+8, 2024-5-8 02:43 , Processed in 0.055645 second(s), 7 queries , Apc On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回復 返回頂部 返回列表