#include <Arduino.h>
#include <SoftwareSerial.h>

SoftwareSerial ser(2, 0); // reading port

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  ser.begin(9600);
  pinMode(1, OUTPUT);
  digitalWrite(1, LOW); // read mode
  pinMode(23, OUTPUT);
  digitalWrite(23, HIGH);


  pinMode(LED_BUILTIN, OUTPUT);
  digitalWrite(LED_BUILTIN, HIGH);

  delay(2000);
  Serial.println("Startup");
}

void loop() {
  // put your main code here, to run repeatedly:
  if (ser.available()) {
    Serial.print("WE GOT SOMETHING! ");
    Serial.write(ser.read());
  }
  if (Serial.available()) {
    digitalWrite(1, HIGH);
    delayMicroseconds(30);
    int data = Serial.read();
    ser.write(data);
    Serial.write(data);
    digitalWrite(1, LOW);
    delayMicroseconds(30);
  }
}

