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

req: CODE FOR BINAY TO DECIMEL

I AM DOING A TEMPERATURE INDICATOR CIRCUIT USING PRORCESOR AND LM35; HOW CAN I CONVERT 10 BIT DATA (AFTER CONVERSION ) TO DECIMEL FOR DISPLAYING SAME ON LCD CRYSTEL DISPLAY .

PLZ GIVE THE CODE ALSO(IN MICROPROCESOR C OR ASSEMBLY)...

Parents
  • Anyy; use sprintf(..) function

    void main() {
    
       init_temp();
       lcd_init();
       delay_ms(6);
    
       reset_temp();
    
       while(TRUE)
       {
          current_temp = read_temp();
    
          if(input(RESET_BUTTON)==0)
             reset_temp();
          else if(current_temp>max_temp)
             max_temp=current_temp;
          else if(current_temp<min_temp)
             min_temp=current_temp;
    
          printf(lcd_putc,"\fCurrent Temp: %U F\nMin: %U Max: %U",current_temp,min_temp,max_temp);
          delay_ms(500);
       }
    }
    <endpre>
    
    
    

Reply
  • Anyy; use sprintf(..) function

    void main() {
    
       init_temp();
       lcd_init();
       delay_ms(6);
    
       reset_temp();
    
       while(TRUE)
       {
          current_temp = read_temp();
    
          if(input(RESET_BUTTON)==0)
             reset_temp();
          else if(current_temp>max_temp)
             max_temp=current_temp;
          else if(current_temp<min_temp)
             min_temp=current_temp;
    
          printf(lcd_putc,"\fCurrent Temp: %U F\nMin: %U Max: %U",current_temp,min_temp,max_temp);
          delay_ms(500);
       }
    }
    <endpre>
    
    
    

Children