Limit periodic functions, adding machines, and solenoids