Conditional mapping Arduino/Ableton Live

Hey guys,

I am planning to build a foot controller for Ableton Live. The Connection Kit seems like a fairly simple tool to connect an Arduino input with Ableton to control various parameters. However, I'd be interested in conditional mapping: when mode A is activated, I want digital Input 1 to do X. When mode B is activated, I want the same input (dig1) to do Y.

If I'd use MIDI notes, I guess this could be solved by a simple if-else function. Is there a similar solution for the connection kit?

Thanks in advance!