This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

how to control output voltage of 89c51 to fed led light

how to control output voltage amplitude of 89c51 to fed led light

Parents
  • I got the award for this function. I let you use it.

    void WMP_OUTPUT( int PCT , int CYCULS)
    {
      int COUNT;
    
    LOOP1:
      if ( CYCULS == 0 )
        goto END;
    
      CYCULS = CYCULS - 1;
    
      COUNT = 0;
    
      P1.1 = 1;
    
    LOOP2:
      if ( CNT == PCT )
        goto BRANCH1;
    
      CNT = CNT + 1;
    
      goto LOOP2;
    
    BRANCH1:
    
      P1.1 = 0;
    
    LOOP3:
      if ( CNT == 100 )
        goto BRANCH2;
    
      CNT = CNT + 1;
    
      goto LOOP3;
    
    BRANCH2:
    
      goto LOOP1;
    }
    

Reply
  • I got the award for this function. I let you use it.

    void WMP_OUTPUT( int PCT , int CYCULS)
    {
      int COUNT;
    
    LOOP1:
      if ( CYCULS == 0 )
        goto END;
    
      CYCULS = CYCULS - 1;
    
      COUNT = 0;
    
      P1.1 = 1;
    
    LOOP2:
      if ( CNT == PCT )
        goto BRANCH1;
    
      CNT = CNT + 1;
    
      goto LOOP2;
    
    BRANCH1:
    
      P1.1 = 0;
    
    LOOP3:
      if ( CNT == 100 )
        goto BRANCH2;
    
      CNT = CNT + 1;
    
      goto LOOP3;
    
    BRANCH2:
    
      goto LOOP1;
    }
    

Children