Arduino: printf/fprintf prints question mark instead of float
问题 I have the following code for an Arduino sketch: #include <LiquidCrystal.h> LiquidCrystal lcd(12, 11, 5, 4, 3, 2); static FILE lcdout = {0} ; static int lcd_putchar(char ch, FILE* stream) { lcd.write(ch) ; return (0) ; } void setup() { lcd.begin(16, 2); fdev_setup_stream (&lcdout, lcd_putchar, NULL, _FDEV_SETUP_WRITE); } void loop() { stdout = &lcdout; printf("%.2f Volts", 2.0); } The problem comes at the last line of the code. This should print out "2.00 Volts" but instead, it prints "?