Pages: [1]   Go Down
Author Topic: Will this work on Due (ARM): sprintf(buffer, "x = %f", x);  (Read 448 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

void loop(){
}
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Pages: [1]   Go Up
Jump to: