VC++定时器

    技术2022-05-11  58

    float TV_ChanTab[100] = {       49.75, 57.75, 65.75, 77.25, 85.25,112.25,120.25,128.25,136.25,144.25,   152.25,160.25,168.25,176.25,184.25,192.25,200.25,208.25,216.25,224.25,   232.25,240.25,248.25,256.25,264.25,272.25,280.25,288.25,296.25,304.25,   312.25,320.25,328.25,336.25,344.25,352.25,360.25,368.25,376.25,384.25,   392.25,400.25,408.25,416.25,424.25,432.25,440.25,448.25,456.25,464.25,   471.25,479.25,487.25,495.25,503.25,511.25,519.25,527.25,535.25,543.25,   551.25,559.25,567.25,575.25,583.25,591.25,599.25,607.25,615.25,623.25,   631.25,639.25,647.25,655.25,663.25,671.25,679.25,687.25,695.25,703.25,   711.25,719.25,727.25,735.25,743.25,751.25,759.25,767.25,775.25,783.25,   791.25,799.25,807.25,815.25,823.25,831.25,839.25,847.25,855.25,863.25,    };      void CJsDlg::OnButton1() { // TODO: Add your control notification handler code here   for(a=1;a<=100;a++)  {         m_StartFP =TV_ChanTab[a];      m_Fip = 38.9;       if (m <= (160.25 + m_Fip)*20)     {     IIC1[4] = 0x01;    }    if (m> (160.25 + m_Fip)*20 && a < (471.25 + m_Fip)*20)     {     IIC1[4] = 0x02;    }    if (m >= (471.25 + m_Fip)*20)     {     IIC1[4] = 0x04;    }     }   m = (m_StartFP + m_Fip) * 20;   IIC1[1] = (UCHAR) (m / 256);    IIC1[2] = (UCHAR)m % 256;    IIC.WriteByteBlock(IIC1,5);   IIC.WriteByteBlock(IIC2,5);   Sleep(100);   SetTimer(1,1,NULL);      CString yq1;

     for (b=0;b<=5;b++) {           yq1.Format("%d",IIC1[a]);  yq1.Format("%d",IIC1[b]);  SetDlgItemText(IDC_EDIT1,yq1);   //void CALLBACK TimerProc(1,1,1,1);   //DwTimeStart = GetTickCount();     } }

    void CJsDlg::OnButton2() { // TODO: Add your control notification handler code here SetTimer(1,1,NULL);  UCHAR rf_read; UCHAR if_read; UCHAR *pRead; pRead= IIC.ReadByteBlock(IIC1[0]+1,1); rf_read = *pRead; pRead = IIC.ReadByteBlock(IIC2[0]+1,1); if_read = *pRead; CString yq2; yq2.Format("%x/r/n%x",rf_read,if_read);    SetDlgItemText(IDC_EDIT2,yq2); }


    最新回复(0)