First thing I found out- apparently BI triggers upon receiving the "S01" and stays triggered until I send an "S00". It will literally stay triggered for hours if it only gets the "on". After sending the "off" it takes about 10 seconds to end the triggering, however the "on" trigger happens instantly.
Secondly, make sure if youre using the arduino pins with buttons or whatever to trigger the sending of the serial data, that you use them in pullup mode, because if you use them in conventional mode they will float and mess everything up.
Here is my code thus far, let me know if this helps at all:
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int Byte1;
int Byte2;
int Byte3;
int Byte4;
int Byte5;
int Byte6;
int Byte7;
int Byte8;
void setup() {
Serial.begin(9600);
pinMode(8, INPUT_PULLUP);
pinMode(9, INPUT_PULLUP);
pinMode(13, OUTPUT);
digitalWrite(13, LOW);
lcd.begin(16, 2);
lcd.print("Waiting...");
}
void loop() {
int val = digitalRead(8);
int val2 = digitalRead(9);
lcd.setCursor(13,0);
lcd.print("8:");
lcd.setCursor(15,0);
lcd.print(val);
lcd.setCursor(13,1);
lcd.print("9:");
lcd.setCursor(15,1);
lcd.print(val2);
if(val == 0){
Serial.write('S');
Serial.write('0');
Serial.write('1');
digitalWrite(13, HIGH);
delay(2500);
}
if(val2 == 0){
Serial.write('S');
Serial.write('0');
Serial.write('0');
digitalWrite(13, HIGH);
delay(2500);
}
digitalWrite(13, LOW);
if (Serial.available() > 0) {
lcd.clear();
lcd.print(Serial.available());
delay(2000);
Byte1 = Serial.read();
Byte2 = Serial.read();
Byte3 = Serial.read();
Byte4 = Serial.read();
Byte5 = Serial.read();
Byte6 = Serial.read();
Byte7 = Serial.read();
Byte8 = Serial.read();
lcd.setCursor(0,0);
lcd.print(Byte1, HEX);
lcd.setCursor(3,0);
lcd.print(Byte2, HEX);
lcd.setCursor(6,0);
lcd.print(Byte3, HEX);
lcd.setCursor(9,0);
lcd.print(Byte4, HEX);
lcd.setCursor(0,1);
lcd.print(Byte5, HEX);
lcd.setCursor(3,1);
lcd.print(Byte6, HEX);
lcd.setCursor(6,1);
lcd.print(Byte7, HEX);
lcd.setCursor(9,1);
lcd.print(Byte8, HEX);
delay(2500);
exit;
}
}