Function to draw a decimal number on the screen.

This commit is contained in:
Travis Goodspeed 2017-09-24 16:21:15 -04:00
parent df6c132e83
commit 0108caf7fe

View File

@ -61,6 +61,17 @@ void lcd_digit(int pos, int digit){
}
}
//! Draws a decimal number on the screen.
void lcd_number(long num){
long bcd=0;
int i;
for(i=0;i<8;i++){
bcd|=((num%10)<<(4*i));
num/=10;
}
lcd_hex(bcd);
}
//! Draws hex on the screen.
void lcd_hex(long num){
/* So in an ideal world, we'd have characters arranged nicely into