And here's the sketch for board A
int writer = 52;
int x = 1;
int y = 10;
int charCount = 1;
int digit = 1;
int computeCount = 1;
bool isWriting = false;
bool startReading = true;
bool startWriting = false;
void setup()
{
pinMode(writer, OUTPUT);
}
void loop()
{
codeRead(); //This is the code board A sends to board B to let it know its trying to send something to it.
writeDigits(); //This is in control of the output pin to board B.
}
void codeRead()
{
if (startReading == true)
{
digitalWrite(writer, HIGH);
computeCount = computeCount + 1;
isWriting = true;
}
if (computeCount == 9)
{
digitalWrite(writer, LOW);
computeCount = 1;
startReading = false;
startWriting = true;
isWriting = false;
}
}
void calculateCord()
{
}
void writeDigits()
{
if (startWriting == true and digit == 1 and x == 1 and charCount == 1)
{
digitalWrite(writer, LOW);
charCount = charCount + 1;
isWriting = true;
}
if (startWriting == true and digit == 1 and x == 1 and charCount == 2)
{
digitalWrite(writer, LOW);
charCount = charCount + 1;
}
if (startWriting == true and digit == 1 and x == 1 and charCount == 3)
{
digitalWrite(writer, HIGH);
charCount = charCount + 1;
}
if (startWriting == true and digit == 1 and x == 1 and charCount == 4)
{
digitalWrite(writer, HIGH);
charCount = charCount + 1;
}
if (startWriting == true and digit == 1 and x == 1 and charCount == 5)
{
digitalWrite(writer, LOW);
charCount = charCount + 1;
}
if (startWriting == true and digit == 1 and x == 1 and charCount == 6)
{
digitalWrite(writer, LOW);
charCount = charCount + 1;
}
if (startWriting == true and digit == 1 and x == 1 and charCount == 7)
{
digitalWrite(writer, LOW);
charCount = charCount + 1;
}
if (startWriting == true and digit == 1 and x == 1 and charCount == 8)
{
digitalWrite(writer, HIGH);
charCount = 1;
}
if (startWriting == true and digit == 1 and x == 2 and charCount == 1)
{
digitalWrite(writer, LOW);
charCount = charCount + 1;
isWriting = true;
}
if (startWriting == true and digit == 1 and x == 2 and charCount == 2)
{
digitalWrite(writer, LOW);
charCount = charCount + 1;
}
if (startWriting == true and digit == 1 and x == 2 and charCount == 3)
{
digitalWrite(writer, HIGH);
charCount = charCount + 1;
}
if (startWriting == true and digit == 1 and x == 2 and charCount == 4)
{
digitalWrite(writer, HIGH);
charCount = charCount + 1;
}
if (startWriting == true and digit == 1 and x == 2 and charCount == 5)
{
digitalWrite(writer, LOW);
charCount = charCount + 1;
}
if (startWriting == true and digit == 1 and x == 2 and charCount == 6)
{
digitalWrite(writer, LOW);
charCount = charCount + 1;
}
if (startWriting == true and digit == 1 and x == 2 and charCount == 7)
{
digitalWrite(writer, HIGH);
charCount = charCount + 1;
}
if (startWriting == true and digit == 1 and x == 2 and charCount == 8)
{
digitalWrite(writer, LOW);
charCount = 1;
}
if (startWriting == true and digit == 1 and x == 1 and charCount == 1)
{
digitalWrite(writer, LOW);
charCount = charCount + 1;
isWriting = true;
}
if (startWriting == true and digit == 1 and x == 1 and charCount == 2)
{
digitalWrite(writer, LOW);
charCount = charCount + 1;
}
if (startWriting == true and digit == 1 and x == 1 and charCount == 3)
{
digitalWrite(writer, HIGH);
charCount = charCount + 1;
}
if (startWriting == true and digit == 1 and x == 1 and charCount == 4)
{
digitalWrite(writer, HIGH);
charCount = charCount + 1;
}
if (startWriting == true and digit == 1 and x == 1 and charCount == 5)
{
digitalWrite(writer, LOW);
charCount = charCount + 1;
}
if (startWriting == true and digit == 1 and x == 1 and charCount == 6)
{
digitalWrite(writer, LOW);
charCount = charCount + 1;
}
if (startWriting == true and digit == 1 and x == 1 and charCount == 7)
{
digitalWrite(writer, HIGH);
charCount = charCount + 1;
}
if (startWriting == true and digit == 1 and x == 1 and charCount == 8)
{
digitalWrite(writer, HIGH);
charCount = 1;
}
if (startWriting == true and digit == 2 and y == 10 and charCount == 1)
{
digitalWrite(writer, LOW);
charCount = charCount + 1;
}
if (startWriting == true and digit == 2 and y == 10 and charCount == 2)
{
digitalWrite(writer, LOW);
charCount = charCount + 1;
}
if (startWriting == true and digit == 2 and y == 10 and charCount == 3)
{
digitalWrite(writer, HIGH);
charCount = charCount + 1;
}
if (startWriting == true and digit == 2 and y == 10 and charCount == 4)
{
digitalWrite(writer, HIGH);
charCount = charCount + 1;
}
if (startWriting == true and digit == 2 and y == 10 and charCount == 5)
{
digitalWrite(writer, LOW);
charCount = charCount + 1;
}
if (startWriting == true and digit == 2 and y == 10 and charCount == 6)
{
digitalWrite(writer, LOW);
charCount = charCount + 1;
}
if (startWriting == true and digit == 2 and y == 10 and charCount == 7)
{
digitalWrite(writer, LOW);
charCount = charCount + 1;
}
if (startWriting == true and digit == 2 and y == 10 and charCount == 8)
{
digitalWrite(writer, HIGH);
charCount = 1;
isWriting = false;
}
if (startWriting == true and digit == 2 and y == 20 and charCount == 1)
{
digitalWrite(writer, LOW);
charCount = charCount + 1;
}
if (startWriting == true and digit == 2 and y == 20 and charCount == 2)
{
digitalWrite(writer, LOW);
charCount = charCount + 1;
}
if (startWriting == true and digit == 2 and y == 20 and charCount == 3)
{
digitalWrite(writer, HIGH);
charCount = charCount + 1;
}
if (startWriting == true and digit == 2 and y == 20 and charCount == 4)
{
digitalWrite(writer, HIGH);
charCount = charCount + 1;
}
if (startWriting == true and digit == 2 and y == 20 and charCount == 5)
{
digitalWrite(writer, LOW);
charCount = charCount + 1;
}
if (startWriting == true and digit == 2 and y == 20 and charCount == 6)
{
digitalWrite(writer, LOW);
charCount = charCount + 1;
}
if (startWriting == true and digit == 2 and y == 20 and charCount == 7)
{
digitalWrite(writer, HIGH);
charCount = charCount + 1;
}
if (startWriting == true and digit == 2 and y == 20 and charCount == 8)
{
digitalWrite(writer, LOW);
charCount = 1;
isWriting = false;
}
if (startWriting == true and digit == 2 and y == 10 and charCount == 1)
{
digitalWrite(writer, LOW);
charCount = charCount + 1;
}
if (startWriting == true and digit == 2 and y == 10 and charCount == 2)
{
digitalWrite(writer, LOW);
charCount = charCount + 1;
}
if (startWriting == true and digit == 2 and y == 10 and charCount == 3)
{
digitalWrite(writer, HIGH);
charCount = charCount + 1;
}
if (startWriting == true and digit == 2 and y == 10 and charCount == 4)
{
digitalWrite(writer, HIGH);
charCount = charCount + 1;
}
if (startWriting == true and digit == 2 and y == 10 and charCount == 5)
{
digitalWrite(writer, LOW);
charCount = charCount + 1;
}
if (startWriting == true and digit == 2 and y == 10 and charCount == 6)
{
digitalWrite(writer, LOW);
charCount = charCount + 1;
}
if (startWriting == true and digit == 2 and y == 10 and charCount == 7)
{
digitalWrite(writer, HIGH);
charCount = charCount + 1;
}
if (startWriting == true and digit == 2 and y == 10 and charCount == 8)
{
digitalWrite(writer, HIGH);
charCount = 1;
isWriting = false;
}
}