library for MCPxxxx digital pontetiometer

hi,
in a big project, we need to use the https://github.com/dreamcat4/Mcp4261/blob/master/Mcp4261Example/Mcp4261Example.pde
we have the Mcp4261 library available from GitHub - dreamcat4/Mcp4261: Arduino library for the Microchip MCP4261
but it is not working with the new arduino 1.0.5 compiler. at the same time we use some other librarys that are only in 1.0.0+ version.
how we can convert the library to work with the new compiler?

the error mesage we get is: sketch_aug03a:34: error: 'MCP4261' does not name a type

a lot of the libs can be made 1.0.x compatible by adding these lines (around WProgram.h of course) in the .h file.

#if ARDUINO < 100
#include <WProgram.h>
#else
#include <Arduino.h>
#endif

Very good robtillaart!!!
but can you make it for bummies? i am a mechanic end this is a bit comfusing.....
what is the WProgram.h? and what we have to do exactly??

If you download the Mcp4261 library it consists of a .cpp file and a .h file.
the .h file is the interface and the .cpp is the implementation (roughly speaking).

In the .h file there is a line...........

never mind, the fix is a bit more difficult, see the attachment a version of the mcp4261 lib that compiles under 1.0.4 (should work under all 1.0.x versions.

Please let me know if you can compile it too ,

update:

  • edited a few typos
  • posted a issue on the github to refer to this updated version.

mcp4261.zip (4.49 KB)

Yes!!!
it is compiling! i will check if it is working as it sud.

next step: how can we publish this update to be available for the next users?

thanks!

next step: how can we publish this update to be available for the next users?

already did that, see my previous post:

+ posted a issue on the github to refer to this updated version.

The maintainer of the lib can either update his code or people will find this thread when looking through the issues. Or ...

with the same sircuit i try the Digital Pot Control example that ardunino has. and the pot is changing "randomly" its value.
i measure with a digital osciloscope on pin 13, 2 sets of 8 bit every some ms in 4.015MHz.

with our Mcp4261 i cant measure anytihng anywhere. i thing that for a reason that i dont know SPI is not sending data.

I do not have a MCP nearby so I cannot test it, sorry