chipKIT® Development Platform

Inspired by Arduino™

Printing long long

Created Sat, 11 Jan 2014 13:16:46 +0000 by pito


pito

Sat, 11 Jan 2014 13:16:46 +0000

Maybe that would be of great help when having it in Serial.print(). Adding printing to the print class:

signed long long int
unsigned long long int

What we have now:

D:\ProgramFiles\arduino\uecide\hardware\cores\chipKIT\api/Print.h:64:7: note: candidates are: void Print::println(const String&)
D:\ProgramFiles\arduino\uecide\hardware\cores\chipKIT\api/Print.h:65:7: note:                 void Print::println(const char*) <near match>
D:\ProgramFiles\arduino\uecide\hardware\cores\chipKIT\api/Print.h:66:7: note:                 void Print::println(char, int)
D:\ProgramFiles\arduino\uecide\hardware\cores\chipKIT\api/Print.h:67:7: note:                 void Print::println(unsigned char, int)
D:\ProgramFiles\arduino\uecide\hardware\cores\chipKIT\api/Print.h:68:7: note:                 void Print::println(int, int)
D:\ProgramFiles\arduino\uecide\hardware\cores\chipKIT\api/Print.h:69:7: note:                 void Print::println(unsigned int, int)
D:\ProgramFiles\arduino\uecide\hardware\cores\chipKIT\api/Print.h:70:7: note:                 void Print::println(long int, int)
D:\ProgramFiles\arduino\uecide\hardware\cores\chipKIT\api/Print.h:71:7: note:                 void Print::println(long unsigned int, int)
D:\ProgramFiles\arduino\uecide\hardware\cores\chipKIT\api/Print.h:72:7: note:                 void Print::println(double, int)

So we miss long long stuff (64bit) and double (64bit - this is its precision today).

This is a workaround for example:

char buf[22];
long long int nnn = 123456789012345678LL;
sprintf(buf, "%lld", nnn);
Serial.print(buf);

majenko

Sat, 11 Jan 2014 13:22:01 +0000

The problem is, the Arduino API only uses long in the Print class, so we can't really warrant using long long as it would break the Arduino API compatibility.


Jacob Christ

Wed, 12 Feb 2014 15:15:57 +0000

How would it break compatibility? Couldn't we as chipKIT take the view that Arduino is a subset of chipKIT, kind of like how C is a subset of C++? It also seems like this is something that we might be ahead of the curve on for Due that might be needed there in the future..

Jacob