8 Replies Latest reply on Apr 1, 2013 9:25 AM by philip.nielsen

    Ok I am stumped completly Displaying results

    philip.nielsen

      The code below will print numbers like 3BB1, 120F. I can't get the diplay to read decimal value like 5051 with no letters. I think I tried everything. I used LCD_Char_PrintNumber(HYT221_Read_Buff[1]); I tried sprintf.  What is it that I am missing?

         

      Philip

         

       

         

       

         

       

         

      uint8 HYT221_Read_Buff[4] = {0};

         

      uint8 HYT221_Write_Buff[4] = {0};

         

       

         

       

         

       

         

      void Display_Result(void)

         

      {

         

       

         

       

         

      LCD_Char_Position(0,6);

         

       

         

      LCD_Char_PrintInt8(HYT221_Read_Buff[0] & 0x3f); //Mask HYT humidity the highest two status bits

         

      LCD_Char_PrintInt8(HYT221_Read_Buff[1]);

         

      //    LCD_Char_PrintNumber( HYT221_Read_Buff[1]); 

         

      // void LCD_Char_PrintNumber(uint16 value) ; 

         

      // duty1_string=(HYT221_Read_Buff);

         

      sprintf(HYT221_Read_Buff,CharLCD_PrintNumber(HYT221_Read_Buff);

         

      // sprintf (duty1_string, "%2.2f", duty1);

         

      // LCD_Char_Position(0,6);

         

       //   CharLCD_1_PrintString(duty1_string);

         

       

         

      // LCD_Char_PrintNumber(HYT221_Read_Buff[1]);

         

      LCD_Char_PrintString("      ");

         

      LCD_Char_Position(1,6);

         

          LCD_Char_PrintInt8(HYT221_Read_Buff[2]);

         

      LCD_Char_PrintInt8(HYT221_Read_Buff[3] & 0xfc); //Mask HYT temperature the lowest two status bits

         

          LCD_Char_PrintString("      ");

         

      }