int MJ_pin1 = 2; // from MJ reaing port used for ocupuid (railrod stop signal)
int MJ_pin2 = 3; // from mj reading port use for release pin 2
pinMode(MJ_pin1, INPUT);
pinMode(MJ_pin2, INPUT);
pinMode(bus_reed_1, INPUT);
// INPUT_PULLUP means NO need of 10Kohm to pullup
pinMode(bus_reed_1,INPUT_PULLUP);
pinMode(MJ_pin1,INPUT_PULLUP);
pinMode(MJ_pin2,INPUT_PULLUP);
.
.
if (digitalRead(MJ_pin1) == LOW) {
// let's now do .....
.
}
This is my code
I have serial monitor on and see that my MJ_pin1 goes low (without anything is done)
connection is via pinx to reed switch to GND OR pinx relay GND
I have tested with same result (different program ) and using 10Kohm and have same result
Have I done some mistakes?
What can I do to avoid this ?
Sven Åke