8 Replies Latest reply on Nov 7, 2015 1:10 PM by user_1377889

    hex to dec query

    cathal.ferrydl_1479341

      Hi,

         

      Ive been looking at interfacing an lm35 to the PSOC 3, ive looked at the sample ADC single ended mode, Ive modified the output to convert the output from the adc to temperature as such: temp =(float)output*100/1023;

         

      I am using the ADC in 10 bit mode, I want a float output.

         

      Problem is, that the output is the temperature but still in hex, so the room temperature is currently 25c but it comes up as 19H which is correct but not ideal.

         

      Ive looked at a few topics from here:

         

      This one: http://www.cypress.com/forum/known-problems-and-solutions/problem-whit-psoc1-adcinc-and-lm35

         

      and this one: www.cypress.com/forum/psoc-1-device-programming/decode-hex-dec

         

      Ive tried implementing what Bob has suggested from the second topic, but the compiler doesnt like that there is no ANSI function prototype for this fuction: csprintf

         

      Ive included the stdio.h library file too, anything (probably obvious) I am missing?

         

      thanks

         

      Kind regards