Skip to content

Instantly share code, notes, and snippets.

@netham45
Created March 14, 2021 01:31
Show Gist options
  • Save netham45/52d06f7095c579679fcce3ec5b27e6a1 to your computer and use it in GitHub Desktop.
Save netham45/52d06f7095c579679fcce3ec5b27e6a1 to your computer and use it in GitHub Desktop.
Arduino Eiki EIP-U4700 Ballast Bypass
/*
Needs customSoftwareSerial library, ballast->projector on pin 4, projector to ballast on pin 3.
*/
#include <CustomSoftwareSerial.h>
CustomSoftwareSerial ballastToProjector(2,3,true /*Invert logic*/);
CustomSoftwareSerial projectorToBallast(4,5);
void setup() {
Serial.begin(115200);
Serial.write("Arduino Present\n");
ballastToProjector.begin(9600,CSERIAL_8E1);
projectorToBallast.begin(9600,CSERIAL_8E1);
}
char buffer[64];
unsigned char data;
uint8_t skipNext = 0;
uint8_t power = 0;
void loop() {
if (projectorToBallast.available())
{
data = projectorToBallast.read();
sprintf(buffer,"Got 0x%02X projectorToBallast\n",data);
Serial.print(buffer);
if (data == 0x70)
power = 1;
if (skipNext > 0)
skipNext--;
else
if (power)
{
ballastToProjector.write(data);
if (data == 0xF0)
{
data = 0;
ballastToProjector.write(data);
}
else if (data == 0xF1)
{
data = 02;
ballastToProjector.write(data);
data = 20;
ballastToProjector.write(data);
}
else if (data == 0xF3)
{
data = 2;
ballastToProjector.write(data);
}
else if (data == 0xF2)
{
data = 4;
ballastToProjector.write(data);
}
else if (data == 0xF4)
{
data = 128;
ballastToProjector.write(data);
}
else if (data == 0xF6)
{
data = 5;
ballastToProjector.write(data);
}
else if (data == 0xFA)
{
data = 'e';
ballastToProjector.write(data);
}
else if (data == 0xFB)
{
data = 128;
ballastToProjector.write(data);
}
else if (data == 0xF5)
{
data = 1;
ballastToProjector.write(data);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment