I'm using the driver code for the mcp23017 from the NET Micro Framework Toolbox but the boolean "inverted" option appears to have no effect. This is set to false in the line
data = mux.CreateParallelOut(0, 10,false)
But there is no change even when set to "true"/
I am writing to a 10 led bar graph directly from the MCP23017 outputs (the anode of each led is pulled to +3.3v via a resistor). If the inverted boolean option is set to true I expect when I write "0" that the outputs will be inverted (hence at a logic "1") and the leds will remain off. I actually need the inverted option to work.
Please, can anyone advice why it is not functioning as expected?
namespace mcp23017
{
public class Program
{
static Mcp23017 mux;
private static IParallelOut data;
public static void Main()
{
mux = new Mcp23017(32, 100);
data = mux.CreateParallelOut(0, 10,false);
while (true)
{
data.Write(0);
Thread.Sleep(250);
data.Write(1023);
Thread.Sleep(250);
}
}
}
}
MCP23017 parallel output operation.
Started by philvr, Aug 27 2013 09:35 AM
2 replies to this topic
#1
Posted 27 August 2013 - 09:35 AM
#3
Posted 08 November 2013 - 10:10 AM
Just a belated "Thanks" to cloris! Your first post was very helpful in getting me started with the MCP23017. We have since modified the paralel i/o routines to use a "write short" technique that is in line with the 16 pins available on the chip.
We are using the MCP23017 to drive a 10 led bargraph that displays an indication of DC current flow in a battery charge/discharge system...some of the spare lines will drive a piezo sounder and read from a push button switch (but that code has yet to be developed).
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users