Simple code for rotary encoder controlling MCP4131

Hi, I'm pretty new to Arduino, and have yet to find a book/reference that goes into detail for programming code. I would like to control a MCP4131 potentiometer chip via an Arduino and also using a rotary encoder. I have found multiple sites showing either the output or the input but not both.
I would be very grateful for a basic code to allow me to construct this and then be able to go over the coding and circuit - to learn from.
Thank you.

which arduino are you using?
what rotary encoder? have a look at Encoder library

have a look at mcp4131-library

I'm actually using the arduino uno. I'll have a look at what you have suggested, thank you.

before you attempt to implement your project make sure you test the individual modules in separate programs, e.g. usually libraries come with example code for this purpose
when you know the individual modules work ok you can start implementing the project

I would recommend you get a copy of the Arduino Cookbook, it has a lot of projects and explains them along with code.

Thank you so much Gilshultz, I have one on order now.