[SOLVED]splitting int to print each value to 7seg

hi folks, checked everywhere for this, for a long time now. checked here and the reference, experimented with highbyte, lowbyte etc. example, using max7219, wanting to take a value say "24" split it to write "2" to one segment, and "4" to the other. thanks.

int =24
Serial.print((a/10)%10);
Serial.print(a%10);

results = a "2" and a "4".

You've got a couple things there.

24 in decimal is 0x0018, so highbyte & lowbyte will give 0x00 and 0x18, not really what you want.

If you use the modulo command I think you can split 24 decimal into 2 and 4.

Then its just a matter sending the data to the appropriate registers in the MAX7219.
I believe register 1 would be digit 0 for the 4, and register 2 would be digit 1 for the 2 in your example.

ok great thanks! back to work now lol. ya the 7219 is working fine no issues where to send the values, just need to split it. let me start thx again.

hmm looks like modulo just does division? still messin with it. NOPE that did it. thank you. works fine, ez too. solution in op.