I want to convert a 2 digit fahrenheit reading to 2 numbers eg 6,5 so i can send data to 7 segment leds
I am using the led-matrix library - but I am not happy with the way I am getting values....
Does anyone know the best way to "chomp" this data?
I want to convert a 2 digit fahrenheit reading to 2 numbers eg 6,5 so i can send data to 7 segment leds
I am using the led-matrix library - but I am not happy with the way I am getting values....
Does anyone know the best way to "chomp" this data?
int digit1 = number / 10;
int digit2 = number % 10;
Mikal
You must live in a cold climate if the temperature never gets above 99 degrees F
If you ever do need to convert more digits, this routine can be expanded to any number of digits:
#define MAX_DIGITS 3
int val = 23; // test with value of 23
int digits[MAX_DIGITS];
for(int i=0; i < MAX_DIGITS; i++){
digits = val %10;