i’m facing a new problem, this time with the IO60P16 module.
i’m trying to read inputs.
the input electrical signal sent to the port Port1_Pin0 is around 3V and is provided by another power supply. GNDs are connecteds.
i have a physical button, a pull-down resistor. if pressed, 3V, if not 0V. i can check this voltage with a multimeter and at this level, it seems to be ok.
i’ve tried GHI driver :
var input = new IO60P16.InputPort(IO60P16.IOPin.Port1_Pin0, IO60P16.ResistorMode.ResistivePullDown);
or IanLee driver
io60p16 = new GTM.IanLee.IO60P16.IO60P16Module(4);
var input = io60p16.CreateInputPort(IOPin.Port1_Pin0);
input.Resistor = ResistorMode.ResistivePullDown;
input.Read();
next, i simply use a timer to read values :
var t2 = new GT.Timer(1000);
t2.Tick += timer =>
{
Debug.Print("readed value: " + input.Read().ToString());
}
t2.Start();
return;
with GHI driver, i always read false. and with IanLee’s driver i always read true… pushing my button or not does not change anything…
Try the same on port 0. I bet you get different results with the GHI driver. That problem should be fixed in my latest version and is coming to the GHI driver in the next SDK release. Have you pulled the latest code from my repo since last week?
Of course I’m interested! Those functions are so small I’m curious to see what you came up with I’ll take a closer look at all of this later when I get home and integrate it into the source. Thanks!
@ sensei I worked in your changes and did a lot of refactoring tonight including adding ResistorMode & InterruptMode options when creating an InterruptPort. Now you can use the InterruptMode argument to eliminate the double interrupts that were firing on both edges before. It’s still possible to get double interrupts but that’s due to glitch/debounce. The chip doesn’t have a native glitch filter but I’ll probably add one via debounce logic in my next revision. Also, I haven’t tested the ResistorMode changes yet. Let me know if you find anything not working there. Enjoy!