Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using System;
- public class SerialHandler : MonoBehaviour
- {
- SerialPortUtility.SerialPortUtilityPro serialPort;
- void Awake()
- {
- serialPort = this.GetComponent<SerialPortUtility.SerialPortUtilityPro>();
- }
- public void Update()
- {
- if (serialPort != null)
- {
- if (Input.GetKey(KeyCode.A))
- {
- serialPort.WriteCR("1");
- } else if (Input.GetKey(KeyCode.S)) {
- serialPort.WriteCR("0");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement