I’m working on a project with the Open source PLC (wrapped around an Arduino Mega) and trying to use the output pins. The hardware I’m using is described here. However, I have not gotten the pins to work. Since the output pins are D38-D45, I would try writing a line like
to get the device to send voltage to pin D40. The line compiles and runs just fine. But when I measure the output with a volt meter, it gives a reading of <100mV, and more importantly, not significantly different than the output of
I tried measuring the voltage against both the common for the digital outputs, and the ground of the device- no difference in reading. I also tried wiring the common to the ground- still no difference. I tried looking for if I have the wrong number on the pin. I tried replacing the “40” with “D40”, in case that was a library-defined name for the pin, but it wasn’t, so that threw a compiler error. I tried this with multiple of the pins- did not make a difference.
I tried with and without the line
still no difference
I know the analog and digital inputs are working because I’ve been successfully using them. Same with the RS-232 pins and the relays.
Should this work, or is there something that I’m missing? Is there something special I need to do to make digitalWrite work? I’m open to suggestions.