|
~: Program for Pick n place robot in VC++ :~
void CMyroboDlg::OnClk() { // TODO: Add your control notification handler code here UpdateData(TRUE); switch(m_angle) { case 0: { dely = 2500; break; } case 1: { dely = 5000; break; } case 2: { dely = 7500; break; } case 3: { dely = 10000; break; } case 4: { dely = 12500; break; } case 5: { dely = 15000; break; } } UpdateData(FALSE); _outp(0x0378,0x01); Sleep(dely); _outp(0x0378,0x00); }
void CMyroboDlg::OnAclk() { // TODO: Add your control notification handler code here UpdateData(TRUE);
switch(m_angle) { case 0: { dely = 2500; break; } case 1: { dely = 5000; break; } case 2: { dely = 7500; break; } case 3: { dely = 10000; break; } case 4: { dely = 12500; break; } case 5: { dely = 15000; break; } } UpdateData(FALSE); _outp(0x0378,0x03); Sleep(dely); _outp(0x0378,0x00);
}
void CMyroboDlg::OnUp() { // TODO: Add your control notification handler code here _outp(0x0378,0x08); Sleep(500); _outp(0x0378,0x00); }
void CMyroboDlg::OnDwn() { // TODO: Add your control notification handler code here _outp(0x0378,0x18); Sleep(500); _outp(0x0378,0x00); }
void CMyroboDlg::OnOpn() { // TODO: Add your control notification handler code here _outp(0x0378,0x10); Sleep(500); _outp(0x0378,0x00); }
void CMyroboDlg::OnClos() { // TODO: Add your control notification handler code here _outp(0x0378,0x30); Sleep(500); _outp(0x0378,0x00); }
void CMyroboDlg::OnXit() { // TODO: Add your control notification handler code here OnOK(); }
void CMyroboDlg::OnMouseMove(UINT nFlags, CPoint point) { // TODO: Add your message handler code here and/or call default if((nFlags & MK_LBUTTON) == MK_LBUTTON) { _outp(0x0378,0x02); Sleep(250); _outp(0x0378,0x00); } else if((nFlags & MK_RBUTTON) == MK_RBUTTON) { _outp(0x0378,0x06); Sleep(250); _outp(0x0378,0x00); }
CDialog::OnMouseMove(nFlags, point); } |