updating an int from its individual digits

Hi all,

I have a bunch of integers (4 digit max) on my sketch, they are settings I can visualize in a LCD. To the Arduino I have 4 buttons: up, down, rigth, left.

I am able to navigate with the buttons to each digit of the int with the left/rigth buttons. What I want to do is using the up/down, change the highlighted digit from 0 to 9.

Example, let's say I have the digit 1234 and the 3 is highlighted. Using up/down I want to cange from 1294 to 1204.

The problem I'm experiencing is to limit this range. In this example, if I reach the 1294 and I press up againg I get 1304.

I figured out I need to split this int into its digits, but I'm stuck at doing that.

Any suggestions?

Thanks in advance!

Post your code. Use ctrl-t to format in the ide. use code tags to post it here.

CrossRoads: Post your code. Use ctrl-t to format in the ide. use code tags to post it here.

Yeah, I forgot about that. I posted and got to bed...

But no problem, I just found how in this stackoverflow thread: http://stackoverflow.com/questions/15728816/how-to-split-integer-into-component-digits

Thanks anyway!