본문 바로가기

초음파 SRF-05 실행시키기 정말 이해하기 힘들었던 초음파를 오늘은 깨달을 수 있었다. 먼저 분주비에 대한 이해 - 자세한건 파일 첨부. MCK -> 48*1024*1024 분주비는 총 5개(2, 8, 32, 128, 1024) 카운터 -> MCK/분주비 1Cycle time -> 1/카운터 1Cycle time us(micro sec) -> 1Cycle time*1000000 RC -> 1초/1Cycle time 소리는 온도 24C 기준 1초에 346m까지 감 ultra.c 에 관한 소스 #include "ultra.h" static unsigned int uiDis; // 초음파와 물체간의 거리 변수,외부에서 접근하지 못하도록 static(c만의 유일한기법) static unsigned char buf[] = "000Cm\n\r.. 더보기
폰트 1. CreateFont 폰트를 만들기 위해 필요한 함수 (핸들은 HFONT) HFONT CreateFont(int nHeight, int nWidth, int nEscapement, int nOriention, int fnWeight, DWORD fdwltalic, DWORD fdwUnderline, DWORD fdwStrikeOut, DWORD fdwCharSet, DWORD fdwOutPrecision, DWORD fdwCilpPrecision, DWORD fdwQuality, DWORD fdwPitchAndFamily, LPCTSTR lpszFace); 인 수 설 명 nHeight 폰트의 크기 설정 nWidth 폰트의 폭 설정 nEscapement 폰트의 각도를 0.1도 단위 설정 nOrienti.. 더보기
비트맵 순서 1. Bitmap 프로젝트를 만들고 소스작성 2. 비트맵 출력에 사용될 비트맵을 준비 3. 비트맵 리소스를 만든다. - 이미 만들어져 있는 비트맵을 임포트(Import) #include "resource.h" LRESULT OnPaint(HWND hWnd, WPARAM wParam, LPARAM lParam) { HDC hdc, MemDC; PAINTSTRUCT ps; HBITMAP MyBitmap, OldBitmap; hdc = BeginPaint(hWnd, &ps); MemDC = CreateCompatibleDC(hdc); MyBitmap = LoadBitmap(g_hInst, MAKEINTRESOURCE(IDB_BITMAP1)); OldBitmap = (HBITMAP)SelectObject(.. 더보기