kalinchuk / ATEM_Wireless_Tally_Light

Wireless tally light system for ATEM switchers.
Other
31 stars 11 forks source link

Misuse of Analog/digital pin functions #1

Open mwsfreak opened 4 years ago

mwsfreak commented 4 years ago

There seems to be a major misunderstanding in the use of AnalogWrite and DigitalWrite functions in ATEM_Tally_Receiver.ino

int PROGRAM_PIN = A0;
int PREVIEW_PIN = A1;
int POWER_PIN = A2;

Led pins are set to Analog Input pins (l. 4+7+10). These pins are also capable of outputting digital signals, however not PWM signals.

analogWrite(PROGRAM_PIN, 1023);
analogWrite(PREVIEW_PIN, 1023);
analogWrite(POWER_PIN, 1023);  

Later (l. 50-52), an attempt is made to apparently output af PWM signal on these same pins.

digitalWrite(PREVIEW_PIN, 1023);
digitalWrite(PROGRAM_PIN, 1023);
digitalWrite(POWER_PIN, 1023);

Further down, one attempts to write a value to a digital pin. The digitalwrite function only accepts HIGH and LOW.

The methods used probably works, but it seems quite far from the intended use of the functions.

kalinchuk commented 4 years ago

@mwsfreak It may be a mistake. This repo is not being actively maintained. If you create a tested PR, I can merge it into master.

mwsfreak commented 4 years ago

@mwsfreak It may be a mistake. This repo is not being actively maintained. If you create a tested PR, I can merge it into master.

I can create a PR, but unfortunately I don't have the hardware to test it at the moment.