Danh mục

Giáo trình thiết kế thiết bị bán dẫn chứa các mạch logic điện tử có khả năng xử lý dữ liệu p8

Số trang: 11      Loại file: pdf      Dung lượng: 152.57 KB      Lượt xem: 7      Lượt tải: 0    
Hoai.2512

Hỗ trợ phí lưu trữ khi tải xuống: 5,000 VND Tải xuống file đầy đủ (11 trang) 0
Xem trước 2 trang đầu tiên của tài liệu này:

Thông tin tài liệu:

Dòng khởi động của động cơ là: Ikđ =(5 ữ7 ).In = (5 ữ7 ).0,625 = 3,125 ữ 4,375 A làm khoá đóng cắt cho động cơ làm việc. Dòng qua C828 đ−ợc xác định như,Sơ đồ mạch động lực điều khiển tốc độ quay động cơ Động cơ điện một chiều ta sử dụng có công suất định mức Pn = 15 W
Nội dung trích xuất từ tài liệu:
Giáo trình thiết kế thiết bị bán dẫn chứa các mạch logic điện tử có khả năng xử lý dữ liệu p8 78LUAÂÄN VAÊN TOÁT NGHIEÄPextern int GetMtx();extern int GetMty();//extern EVENT OldEvent();extern int Double(LPEVENT);#endif// End of MOUSE.HIX.MODULE MOUSE.CPP#include #include //#include #include #include mouse.hvoid SetMouseRange(LPRECT lpRect)// Dat vung di chuyen cho chuot{ _AX = 0x07;//ham 07 cua ngat 33 de dinh gioi han di chuyen ngang _CX = lpRect->left; _DX = lpRect->right; geninterrupt(INT_MOUSE);//INT_MOUSE=0x33:ngat 33 _AX = 0x08;//ham 08 cua ngat 33 dinh gioi han di chuyen doc cho contro _CX = lpRect->top; _DX = lpRect->bottom; geninterrupt(INT_MOUSE);}//---------------------------------------------------------int InitMouse(LPRECT lpRect)// Khoi dong chuot{ int ax; _AX = 0; geninterrupt(INT_MOUSE); ax = _AX; if (ax == 0) return FALSE; SetMouseRange(lpRect); return TRUE;}//---------------------------------------------------------void ShowMouse(void)// Hien thi chuot{ _AX = 1; geninterrupt(INT_MOUSE);}//---------------------------------------------------------void HideMouse(void)// Dau chuot{ _AX = 2; geninterrupt(INT_MOUSE);}//---------------------------------------------------------#include #include void MouseRead(LPEVENT lpEvent)// Tra ve bien co nhan duoc tu chuot : Nut trai hay phai duoc an{ 79LUAÂÄN VAÊN TOÁT NGHIEÄP int bx; _AX = 3; geninterrupt(INT_MOUSE); bx = _BX; //cx = _CX; //dx = _DX; lpEvent->Msg = bx; lpEvent->Posx = _CX; lpEvent->Posy = _DX; gettime(lpEvent->t);}//---------------------------------------------------------void ResetEvent(LPEVENT lpEvent){ lpEvent->Msg = 0; lpEvent->Posx = lpEvent->Posy = 0;}//---------------------------------------------------------EVENT PrevEvent, CurEvent;//---------------------------------------------------------LPEVENT GetEvent(void){ ResetEvent(&CurEvent); MouseRead(&CurEvent); // chuyen sang toa do ViewPort CurEvent.Posx = CurEvent.Posx-MainWindow.rViewPort.left; CurEvent.Posy = CurEvent.Posy-MainWindow.rViewPort.top; // xet trang thai chuot co thay doi hay khongif((CurEvent.Posx!=PrevEvent.Posx)&&(CurEvent.Posy!=PrevEvent.Posy)) CurEvent.Msg |= M_CHANGE; PrevEvent = CurEvent;// delay(50); return (&CurEvent);}//---------------------------------------------------------void DeviceRelease(int Msg){ while(GetEvent()->Msg&Msg);}//---------------------------------------------------------int Double(LPEVENT lpEvent){ if(lpEvent->Msg==1) { delay(100); ResetEvent(lpEvent); lpEvent=GetEvent(); if(lpEvent->Msg==1) //if((abs(CurEvent.Posx-oldEvent.Posx)) 80LUAÂÄN VAÊN TOÁT NGHIEÄPvoid MouseText(int x,int y,int color1,int color2)//,char s[])//gia daunhay con tro{ HideMouse();// int h=textheight(s); int w=5; int color=getcolor(); do { for(int i=0;i 81LUAÂÄN VAÊN TOÁT NGHIEÄP RECT rSys; /*System area of window*/ RECT rTitleBar; /*Caption area of window*/ RECT rMenuBar; /*Rectangle in which windows menu islocated*/ RECT rMessage; /* Rectangle in which messages is display}WINDOWS;// Dinh nghia cac ham va bien dung toan cucextern int Xc, Yc; // Goc toa doextern int LineColor;extern int VP_WIDTH;extern int VP_HEIGHT;extern WINDOWS MainWindow;extern void InitGraphics(void);extern void OutMessage(char *Msg);extern void InitScreen(void);extern void InitValues(char *lpCaption);extern int OutError(char *s);#endif// End of SCREEN.HXI.MODULE SCREEN.CPP#include #include #include #include #include #include screen.h#include mouse.hint T_SIZE, W_SIZE, H_SIZE, W_CHAR, H_CHAR, MSG_SIZE;int COLOR_WINDOW;int COLOR_BUTTON;int COLOR_BORDER;int COLOR_CAPTION;int COLOR_TEXT;int VP_WIDTH;int VP_HEIGHT;int Maxx, Maxy; // Maxx - Maxy of screenWINDOWS MainWindow;//int Xc, Yc; // Goc toa do//int LineColor = MAGENTA; // Mau cua duong thang can ve - Dung trongthu tuc SetPixel//---------------------------------------------------------void InitGraphics(void)// Khoi tao che do do hoa{ int grDrv=DETECT, grMode; int ErrCode; initgraph(&grDrv, &grMode, ); ErrCode = graphresult(); if(ErrCode!= grOk) { printf(Graphics error: %s , grapherrormsg(ErrCode)); printf(Press any key to halt...); getch(); exit(1); /* return with error code */ } Maxx = getmaxx(); ...

Tài liệu được xem nhiều: