Hi all, I need some help with the MCP4131 library that I downloaded from the code share here, i.e. https://www.ghielectronics.com/community/codeshare/entry/344
I’m using Hydra mainboard, so I changed the call to the constructor, instead of
MCP4131 myMCP4131 = new MCP4131((Cpu.Pin)FEZHydra_Pins.PB8, SPI.SPI_module.SPI1);
To->
MCP4131 myMCP4131 = new MCP4131((Cpu.Pin)GHI.Hardware.FEZHydra.Pin.PB8, SPI.SPI_module.SPI1);
(Now it compiles…)
I created a new gadgeteer project and there a new class called MCP4131 and put there the implementation of the object.
At program.cs added the followning namespaces:
using System;
using System.Collections;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Presentation;
using Microsoft.SPOT.Presentation.Controls;
using Microsoft.SPOT.Presentation.Media;
using Microsoft.SPOT.Touch;
using Microsoft.SPOT.Hardware;
using Gadgeteer.Networking;
using GT = Gadgeteer;
using GHIElectronics;
//using GHIElectronics.NETMF.FEZ; // for FEZ -----> commented because it didn't compile
using GHI.Hardware.FEZHydra;
using GTM = Gadgeteer.Modules;
Using the extender I connected the MCP4131 to socket #3 (type S) on my Hydra board and the scheme is attached.
I’m running the program.cs (it compiles) but all I get is
i=128
Wiper REG: 0
Status REG: 0
TCON: 0
i=127
Wiper REG: 0
Status REG: 0
TCON: 0
In other words just zeros.
I’m not sure what is wrong and I have no idea how to debug it.
Any help would be useful, I will be grateful until the end of my life =)