Go Down

Topic: uint64_t in Serial.print (Read 4 times) previous topic - next topic

robtillaart

#5
Nov 25, 2012, 06:19 pm Last Edit: Nov 25, 2012, 07:09 pm by robtillaart Reason: 1
I'll will try the code myself, be back asap
[update]
unexpected conflicts - pity ...
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

robtillaart

a workaround: print it in 2 steps

Code: [Select]
void setup()
{
  Serial.begin(9600);
  Serial.println("start...");
 
  uint64_t ll = 123456789012345678ULL;
  uint64_t xx = ll/1000000000ULL;

  if (xx >0) Serial.print((long)xx);
  Serial.print((long)(ll-xx*1000000000));
}

void loop(){}
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Steve Spence - KK4HFJ

ok. I get

start...
12345678912345678
Steve Spence - ET/AT/R&D KK4HFJ

robtillaart

does this 'trick' solve your problem enough?

An "integrated solution" is more difficult than I expected.
I also had a quick look at - http://www.nongnu.org/avr-libc/user-manual/modules.html - but found no solutions there either.

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Steve Spence - KK4HFJ

Not sure how to merge that into the sd cardinfo sketch .....
Steve Spence - ET/AT/R&D KK4HFJ

Go Up