コード例 #1
0
 void Start()
 {
     _serial                 = new SerialHandler();
     _serial.portName        = COMPort;
     _serial.baudRate        = 115200;
     _data[0]                = (byte)'d';
     _serial.OnDataReceived += OnDataReceived;
     _serial.Open(false);
 }
コード例 #2
0
 // Use this for initialization
 void Start()
 {
     Debug.Log("@SerialTestClient");
     SerialHandler.Open();
     SerialHandler.Pressed   += onPressed;
     SerialHandler.Pressing  += onPressing;
     SerialHandler.Released  += onReleased;
     SerialHandler.SwitchOn  += onSwitchOn;
     SerialHandler.SwitchOff += onSwitchOff;
 }
コード例 #3
0
//     [Inlet]
//     public float Actuator5
//     {
//         set
//         {
//             Actuators[4] = CheckTemp(value);
//         }
//     }

    void Start()
    {
        _serial                 = new SerialHandler();
        _serial.portName        = COMPort;
        _serial.baudRate        = 115200;
        _serial.OnDataReceived += OnDataReceived;
        _serial.Open(true);
        Thread.Sleep(500);

        for (int i = 0; i < 4; ++i)
        {
            _average[i] = new MovingAverageF(SamplesCount);
        }
    }
コード例 #4
0
    void Start()
    {
        serial = SerialHandler.Instance;
        bool success = serial.Open(portNum, SerialHandler.Baudrate.B_115200);

        if (!success)
        {
            return;
        }
        serial.OnDataReceived += SerialCallBack;
//
        player = GameObject.Find("Player") as GameObject;
//
//
    }
コード例 #5
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     ourPort = new SerialHandler(comCombo.SelectedItem.ToString(), int.Parse(baudCombo.SelectedItem.ToString()));
     ourPort.Open();
 }
コード例 #6
0
 void Start()
 {
     SerialHandler.Open();
 }
コード例 #7
0
    //For debug
    //will not need soon

    /*
     * public void portSetter (int p1, int p2, int p3, int p4, int p5){
     *      text_MessageLog.text = "port set";
     *      tmpInt_p1 = p1 - 33024;
     *      tmpInt_p2 = p2 - 33024;
     *      tmpInt_p3 = p3 - 33024;
     *      tmpInt_p4 = p4;
     *      tmpInt_p5 = p5;
     * }
     */

    //For debug
    public void serialOpener()
    {
        serialHandler.Open();
    }