I have two identical Mega2560s with Grounds connected together, Pin 13 on one is connected to Pin 12 on the other and vice-versa.
A pigtail of wire on Pin 9 that I can touch to ground and an LED with a 330 ohm resistor on Pin 8.
I get like a 5-10 sec delay on the LED response when I use the following program. (Same program loaded on both units.)
What am I doing wrong?
Eventually, I'd like to pass arrays of floats and such. A little more than a single bool value.
#include <SoftwareSerial.h> const int rxPin = 12; //RS-232 Serial data RX pin const int txPin = 13; //RS-232 Serial data TX pin SoftwareSerial MySerial = SoftwareSerial(rxPin, txPin); bool selfconnected; bool prtnconnected; int LED_pin = 8; int WIRE_pin = 9; void setup() { // put your setup code here, to run once: MySerial.begin(9600); Serial.begin(9600); pinMode(LED_pin, OUTPUT); pinMode(WIRE_pin, INPUT_PULLUP); } void loop() { // put your main code here, to run repeatedly: if (digitalRead(WIRE_pin) == 1){ selfconnected = 1; } if…