I understand that the Arduboy has a 8-bit processor but I am confused has to what types it can use. I noticed that when I use int
I am really using short
and that if I want the value of a int
I have to use long int
. I also noticed that when coding float
and double
seem to do the give the same precision (two decimal places).
What types does Arduboy support and what are their max and min values? What is the limitations of the Arduboy?
When it comes to coding for the arduboy int
and short
are used interchangeably (what I mean is int = short) which that means max, min and unsigned values are
//Short MIN is -32768
//Short MAX is 32767
//Unsigned short MAX is 65535
And long int is really int from a normal computer which means my max, min, and unsigned vales are
//Max value for long int (which is really the MAX val for int) is 2147483647
//Min value for lont int is -2147483648
//Unsigned long value for long int is 4294967295
And long long int does not work. Because thatâs just too much for the 8-bit processor? When it comes to float and double. Float and double seem interchangeable in the way int and short are when it comes to the arduboy. I donât get what my bounds are with either? Also how do I use precision if there is any? If I do something like
float test = 12.12345;
arduboy.print(F("FLOAT:"));
arduboy.setCursor(arduboy.getCursorX() + 2, arduboy.getCursorY());
arduboy.print(test);
It will only display âFLOAT:12.12â Does that mean in memory it is only stored as test = 12.12 or does arduboy.print() only print out a precision of two? And does the arduboy2.h library or arduboy.h library offer precision control or concatenation like stdio.h printf() or maybe iostream? Where you could write something like
int foo = 12.12345;
printf("\n %0.5f",foo)
int jeff = 57;
printf("\n Jeff's age is %d", 57+1);
Also what does that mean for arrays max values? And linked list and general memory management. Any help would be great thanks. I am still learning.