본문 바로가기

Programming14

Serial to Keyboard (Win, C#, Unity3D) 유니티에서 시리얼통신 입력 받아서 키보드 신호로 만들어주는 기능이 필요해서 찾음. [DllImport("user32.dll")] public static extern void keybd_event(uint vk, uint scan, uint flags, uint extraInfo); 사용법> keybd_event(0x31, 0, 0, 0); // keycode.Alpha1 [vk code] 0x30 ~ 0x39 : Symbol 0 ~ 9 0x41 ~ 0x5A : Symbol A ~ Z https://learn.microsoft.com/ko-kr/windows/win32/api/winuser/nf-winuser-keybd_event keybd_event 함수(winuser.h) - Win32 apps 키 .. 2023. 8. 25.
C#, Unity3D, 외부 프로세스 실행시키기 런쳐 만들어서 외부 프로세스 실행 public class ScProcessStarter : MonoBehaviour { [System.Runtime.InteropServices.DllImport("User32", EntryPoint = "FindWindow")] private static extern System.IntPtr FindWindow(string lpClassName, string lpWindowName); [System.Runtime.InteropServices.DllImport("user32.dll")] public static extern void SetForegroundWindow(System.IntPtr hWnd); [System.Runtime.InteropServices.DllImp.. 2023. 3. 7.
public T GetData(string a_strKey) public T GetData(string a_strKey) { string _strValue; data.TryGetValue(a_strKey, out _strValue); object _value = null; if (typeof(T) == typeof(int)) { _value = int.Parse(_strValue); } if (typeof(T) == typeof(float)) { _value = float.Parse(_strValue); } if (typeof(T) == typeof(string)) { _value = _strValue; } return (T)_value; } 2022. 2. 22.
DTH11 (온습도) VCC : 입력전압 3.3v - 5.0v (라고 하는데 5.0v에서만 실험) GND : 그라운드 DAT : 출력값 측정온도 : 0 ~ 50'C 측정습도 : 20 ~ 90RH # 사용을 위해선 DTH.h 라이브러리 필요합니다. (아두이노 스케치 -> 라이브러리 설치 하세요) (직접 변환하는 방법도 있지만 라이브러리가 편합니다.) # 센서의 데이터는 1초에 한번씩 읽을 수 있으므로 주의. (더 짧은 속도로 읽으려 하면 잘 안됨) 2020. 12. 20.
SZH-SSBH-011 (조도) 가변 저항을 돌리면 디지털 입력의 Threshold값을 정해준다. VCC : 입력전압 (3.3v - 5.0v 라는데 3.3v에선 LED 안켜짐) GND : 그라운드 DO : 디지털 출력 (임계값 넘는 밝기는 0, 어두우면 1) AO : 아날로그 Cds값 (밝을수록 수치가 작음.) /// 20(LED 랜턴 직접 조사) ~ 220(일반 조명밝기) ~ 580(손으로 Cds가림) ... 그냥 가지고 Cds 넘쳐나는데 이걸 왜 샀을까... 2020. 12. 20.
SteamVR Error - "No pose action set for this component" 해결 방법 : [CameraRig]를 Unpack Prefab하면 된다. 하하 2020. 5. 11.