This is a sub-issue of #11. Don't close #11 until all sub-issues are resolved.
I will help with this. Just want to teach the principle too is all since you'll write code faster than I can reformat it :).
To make the code cross-platform and clear, each type should have an explicit size. unsigned int on an ATMega328 is 2 bytes, but on an STM32 it is 4 bytes. uint16_t, however, is always 2 bytes on any platform, period. People may want to move your code to a new platform in the future. This will make the process much better.
Here are the standard types: http://www.cplusplus.com/reference/cstdint/
unsigned int --> uint16_t
unsigned long --> uint32_t
int --> int16_t
long --> int32_t
etc.
nit-picks:
also
byte --> uint8_t
boolean --> bool
This is a sub-issue of #11. Don't close #11 until all sub-issues are resolved.
I will help with this. Just want to teach the principle too is all since you'll write code faster than I can reformat it :).
To make the code cross-platform and clear, each type should have an explicit size.
unsigned inton an ATMega328 is 2 bytes, but on an STM32 it is 4 bytes.uint16_t, however, is always 2 bytes on any platform, period. People may want to move your code to a new platform in the future. This will make the process much better.Here are the standard types: http://www.cplusplus.com/reference/cstdint/
unsigned int-->uint16_tunsigned long-->uint32_tint-->int16_tlong-->int32_tetc.
nit-picks:
also
byte-->uint8_tboolean-->bool