Hi everyone! Ive been looking for more examples of the ArduMax MCP41xxx driver library so that I can attempt to use it on a project of mine with my Arduino Mega2560 and a MCP4151 digital potentiometer.
Ive looked at the "READ ME" documents to clarify anything so Im hoping that this snippet of code would work so long as the arduino and the digipot are hooked up correctly.
Using the provided keywords from the library, this should work right?
Im new to writing C++ for my arduino mega2560 so I am trying to figure out if Im missing anything important before I attempt to use this library.
Ive looked up as much as I can with no success so any feedback on the use of this library would be very helpful, thank you!
Using the provided keywords from the library, this should work right?
It depends on what you expect it to do. You failed to provide a wiring diagram of your setup so if anything went wrong there we are not able to help. Assigning a value of 1010101 to a byte is probably not resulting in what you expected. The byte will contain the value 181 (not 85). Binary literals are prepended by 0b in C/C++.
pylon:
It depends on what you expect it to do. You failed to provide a wiring diagram of your setup so if anything went wrong there we are not able to help. Assigning a value of 1010101 to a byte is probably not resulting in what you expected. The byte will contain the value 181 (not 85). Binary literals are prepended by 0b in C/C++.
Thanks for the reply!
I'm testing the function of the MCP4151 on an LED so that I can apply the same wiper output values to a mass flow controller that takes a 0-5V analog setpoint signal to control the 0-75 SLPM of argon I want to use, thats it.
I'm downloading fritzing at work right now to show you the setup, my apologies. Also its a very special day for me and its almost time to go home so I'm sorry if I don't post the diagram today
Ive wired everything up as closely as I could to other similar setups.
I have a 330ohm resister an LED connected to the wiper of the MCP4151 and since I'm using the mega2560 I've wired the SS, SCK, and the MOSI to Arduino's pins 53( for SS), 52( for SCK), and 51( for MOSI). The 5V from Arduino is connected to a 10K ohm resister(as seen in similar setups.. also tempted to think this might be the problem, but I cant make any assumption based off my VERY limited but still growing knowledge of C++). The 10K ohm resister is connected to the MCP4151's Vdd pin. I also have the Arduino's MISO not hooked to anything.. is it necessary to wire the MISO to something if I'm not using it?