Go Down

Topic: Will this work on Due (ARM): sprintf(buffer, "x = %f", x); (Read 564 times) previous topic - next topic

codom

I know that AVR microcontrollers are unable to print floats using sprintf, but can the Due, an ARM controller, do the following:

Code: [Select]
void setup(){
  Serial.begin(9600);
  while(!Serial);
 
  char buffer[15];
  float x = 1.23;
  sprintf(buffer, "x = %f", x);
  Serial.print(buffer);
}

void loop(){
}

codom

Never mind.  I found someone local who had a Due board and tested it.  It does, in fact, work fine.

Go Up