I am trying to implement a simple code in at Atmega16 where I read an analog value and output the voltage to the USART. I am programming through CodeVision.
word_value=read_adc(0); // this is word value from adc0
printf("channel 1 = %.2f =",volts);
This doesn't work. In fact, I couldn't get any non-integer value to print. I can get this to work by using integer math, but I would rather not. Does anyone know why printf won't allow non-integer values? And does anyone know how to get around this?