Exemplo n.º 1
0
 void Start()
 {
     _serial                 = new SerialHandler();
     _serial.portName        = COMPort;
     _serial.baudRate        = 115200;
     _data[0]                = (byte)'d';
     _serial.OnDataReceived += OnDataReceived;
     _serial.Open(false);
 }
Exemplo n.º 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;
 }
Exemplo n.º 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);
        }
    }
Exemplo n.º 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;
//
//
    }
Exemplo n.º 5
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     ourPort = new SerialHandler(comCombo.SelectedItem.ToString(), int.Parse(baudCombo.SelectedItem.ToString()));
     ourPort.Open();
 }
Exemplo n.º 6
0
 void Start()
 {
     SerialHandler.Open();
 }
Exemplo n.º 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();
    }