long distances data

How long can a cable be depending on its application and which kind of cable is apropiate to use?

For example:

-the cable that connects a LDR to an analog input
-the cable that connects a digital pin to a digital pin in a second board

thanks!

Depends on a lot of factors, like current, electromagnetic interference, speed of signal transitions, etc.

Line drivers can be used to extend the distance

(deleted)

and in case you use RS485, what cable is appropiate?

Try a Google search on;

'cable for rs485'

(deleted)

thanks you very much @spycatcher2k for your answer

Choose your pairs !

lastchancename:
Choose your pairs !

what does this mean?