|
|
|
@ -1,19 +1,24 @@
|
|
|
|
|
/*
|
|
|
|
|
PMA770Relay 0.1
|
|
|
|
|
PMA770Relay 0.1.1
|
|
|
|
|
|
|
|
|
|
dewdude@gmail.com - 29-12-2019
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
#include <Wire.h>
|
|
|
|
|
#include <LiquidCrystal_I2C.h>
|
|
|
|
|
#include <IRremote.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int latchPin = 11;
|
|
|
|
|
int clockPin = 9;
|
|
|
|
|
int dataPin = 12;
|
|
|
|
|
int IRin = 7;
|
|
|
|
|
int matrix = A0;
|
|
|
|
|
|
|
|
|
|
byte out = 0;
|
|
|
|
|
int mx = 0;
|
|
|
|
|
IRrecv remote(IRin);
|
|
|
|
|
decode_results ircode;
|
|
|
|
|
|
|
|
|
|
LiquidCrystal_I2C lcd(0x27,16,2);
|
|
|
|
|
|
|
|
|
@ -71,7 +76,7 @@ void setPh1()
|
|
|
|
|
{
|
|
|
|
|
DontCrossTheStreams();
|
|
|
|
|
bitSet(out,3);
|
|
|
|
|
bitSet(out,1);
|
|
|
|
|
bitSet(out,0);
|
|
|
|
|
updateShiftRegister();
|
|
|
|
|
lcd.setCursor(7, 1);
|
|
|
|
|
lcd.print("PHONO-1 ");
|
|
|
|
@ -81,7 +86,7 @@ void setPh2()
|
|
|
|
|
{
|
|
|
|
|
DontCrossTheStreams();
|
|
|
|
|
bitSet(out,3);
|
|
|
|
|
bitSet(out,2);
|
|
|
|
|
bitSet(out,1);
|
|
|
|
|
updateShiftRegister();
|
|
|
|
|
lcd.setCursor(7, 1);
|
|
|
|
|
lcd.print("PHONO-2 ");
|
|
|
|
@ -92,6 +97,7 @@ void setup()
|
|
|
|
|
pinMode(latchPin, OUTPUT);
|
|
|
|
|
pinMode(dataPin, OUTPUT);
|
|
|
|
|
pinMode(clockPin, OUTPUT);
|
|
|
|
|
remote.enableIRIn();
|
|
|
|
|
bitSet(out,5);
|
|
|
|
|
lcd.init();
|
|
|
|
|
lcd.backlight();
|
|
|
|
@ -112,5 +118,28 @@ int mx = analogRead(matrix);
|
|
|
|
|
if (mx > 900 && mx < 950) setAUX();
|
|
|
|
|
if (mx > 1000) setTune();
|
|
|
|
|
if (mx > 820 && mx < 899) setPh1();
|
|
|
|
|
if (remote.decode(&ircode)) {
|
|
|
|
|
switch(ircode.value){
|
|
|
|
|
case 0xFF6897:
|
|
|
|
|
setTape2();
|
|
|
|
|
break;
|
|
|
|
|
case 0xFF9867:
|
|
|
|
|
setTape1();
|
|
|
|
|
break;
|
|
|
|
|
case 0xFFB04F:
|
|
|
|
|
setAUX();
|
|
|
|
|
break;
|
|
|
|
|
case 0xFF30CF:
|
|
|
|
|
setTune();
|
|
|
|
|
break;
|
|
|
|
|
case 0xFF18E7:
|
|
|
|
|
setPh1();
|
|
|
|
|
break;
|
|
|
|
|
case 0xFF7A85:
|
|
|
|
|
setPh2();
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
remote.resume();
|
|
|
|
|
}
|
|
|
|
|
delay(200);
|
|
|
|
|
}
|
|
|
|
|