I've been trying to use a thermocouple IC (using a SEN-30005 from playingwithfusion.com which embeds a MAX31856) in order to read a Type-J probe and then replicate it with a digital POT (MCP4261, the bare IC this time) in order to emulate a classical variable resistance type temperature probe.
Both modules are hard-wired with one CS on the pin#2 and the other one on the pin#3, they of course share the SPI bus.
It actually works with the two different example sketches I found but when I try to merge them, it just doesn't work...
One of my lead is that one sketch uses the spi.h library while the other doesn't (and does it in soft? just not sure how it works).
So anyway, both sketches are attached (MAX31856 & TESTMCP4161) and the "result" sketch is also there (TEST_POT_TJ).
Would any of you guys be able to point me in the right direction?
Where do I start to troubleshoot this SPI (I think) problem?
Please post the programs here rather than attaching them to avoid the need to download them to get them into the IDE or an editor. Use code tags when you do.
digitalPotWrite(wiper0writeAddr, 0); // Set wiper 0 to 200
digitalPotWrite(wiper1writeAddr, 0); // Set wiper 1 to 200
delay(lung);
digitalPotWrite(wiper0writeAddr, 0); // Set wiper 0 to 200
digitalPotWrite(wiper1writeAddr, 255); // Set wiper 1 to 200
delay(lung);
digitalPotWrite(wiper0writeAddr, 255); // Set wiper 0 to 200
digitalPotWrite(wiper1writeAddr, 255); // Set wiper 1 to 200
delay(lung);
digitalPotWrite(wiper0writeAddr, 255); // Set wiper 0 to 200
digitalPotWrite(wiper1writeAddr, 0); // Set wiper 1 to 200
Those comments can't all be right. Incorrect comments are worse than no comments.
The combined code does something, no matter how useless. You expect the code to do something, no matter how incorrect the comments are. "It doesn't work" doesn't cut it, in terms of telling us what the code actually does, and how that differs from what you want.