Hi all i have a question regarding using an Arduino to power on an optoma projector after the arduino gets a ground to ground input and to send an off command if an off input has been detected i can paste the programming here to see if its an error in my programming or another problem i purchased a max 232 chip ill paste a link here so you guys know what i have now https://www.amazon.com/dp/B07BJJ1T5G?psc=1&ref=ppx_yo2ov_dt_b_product_details
i can see when i trigger the on contact it is sending something and i then used the serial monitor in arduino ide and its sending the on command but im not sure why the projector is still not powering on it could be i dont have the right hardware or my programming has an error but if you guys have any ideas as to why id love to try any method you guys have ill post my code below
//Global Variables
const int pwron = 12; // On Relay declaration
const int pwroff = 13; // Off relay declaration
bool projectorOn = false;
void setup()
{
Serial.begin(9600); // Declaring and Setting the serial Baud rate
pinMode(pwron, INPUT_PULLUP); // Setting the on relay as an input
pinMode(pwroff, INPUT_PULLUP); // Setting the off relay as an input
}
void loop() {
if(!projectorOn) {
if(digitalRead(pwron) == LOW && digitalRead(pwroff) == HIGH) {
ProjectorOnCommand(); // Turn Projector on
projectorOn = true;
}
}
if(projectorOn) {
if(digitalRead(pwroff) == LOW && digitalRead(pwron) == HIGH) {
ProjectorOffCommand(); // Turn Projector off
projectorOn = false;
}
}
}
void ProjectorOnCommand() {
Serial.println("~0000 1");
delay(1000);
}
void ProjectorOffCommand() {
Serial.println("~0000 0");
delay(1000);
}``