I have a # from 0 to 120
I get this # from a GPS and then print it out to an OLED and 4x20 i2c LED
all of that works dandy.
BUT I want to use large #'s for the speed
I need to split each # into an array or something so that say 0 - 9 would be single digit and pass it on
so it will print large #'s and if it's more then 1 char then to pass both #'s and more than 3 it will pass all
3
but for now a few static #'s are what I am dealing with to make it easy on my brain to try to grasp
What I don't want to do is 120 if statements lol.
#define CurSpeed 0
//#define CurSpeed 65
//#define CurSpeed 120
if (CurSpeed < 10) {
printbigchar(CurSpeed, 0, 2);
}
if (CurSpeed >= 10) {
printbigchar(CurSpeed1stDigit, 0, 2);
printbigchar(CurSpeed2ndDigit, 4, 2);
}
if (CurSpeed >99) {
printbigchar(CurSpeed1stDigit, 0, 2);
printbigchar(CurSpeed2ndDigit, 4, 2);
printbigchar(CurSpeed3rdDigit, 8, 2);
}
lcd.print("MPH");}
say 0 - 9 would be
printbigchar(CurSpeed, 0, 2); // this one works lol
then 10 - 99 would be
printbigchar(6, 0, 2);
printbigchar(5, 4, 2);
or say 120 would be
printbigchar(1, 0, 2);
printbigchar(2, 4, 2);
printbigchar(0, 8, 2);
any help would be greatly appreciated