C
C#3y ago
Boson

❔ Serial Communication

Hi. Nothing is being printed to the console and I have no idea why.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.IO.Ports;

public class ArduinoController : MonoBehaviour
{
SerialPort serial;

void Start() //called once when the program is run
{
serial = new SerialPort("COM3", 9600);
serial.Open();
}

void Update() //called once every frame
{
string data = serial.ReadLine();
Debug.Log(data);
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.IO.Ports;

public class ArduinoController : MonoBehaviour
{
SerialPort serial;

void Start() //called once when the program is run
{
serial = new SerialPort("COM3", 9600);
serial.Open();
}

void Update() //called once every frame
{
string data = serial.ReadLine();
Debug.Log(data);
}
}
2 Replies
Boson
BosonOP3y ago
I have checked data is being sent on the COM3 port correctly juat nothing is being read
Accord
Accord3y ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.

Did you find this page helpful?