Gast
#2264704
Hallo da es mir winavr nicht möglich ist 64Bit Zahlen via RS232 aus zu
geben, habe ich mir versucht eine eigene Funktion zu schreiben, nur
leider bin ich am verzweifel weil ich sie einfach nicht richtig zum
laufen bekomme... vellt kann ja einer mal drüber schauen:)
void printLongLong(uint64_t value)
{
printfHex64(value);
uint16_t digits = 0;
uint64_t valueCopy = value;
while (valueCopy > 0)
{
valueCopy = valueCopy / (uint64_t)10;
digits++;
}
valueCopy = value;
// eight digits can be casted in 32bit
while (digits > 9)
{
uint64_t difference = pow((double)10, (double)(digits - 1));
uint8_t currentDigit = valueCopy / difference;
valueCopy = valueCopy - (difference * (uint64_t)currentDigit);
digits--;
printf("%c", currentDigit);
}
}
Vielen Dank
Dominik