Initial Commit
							parent
							
								
									7ffa7619c8
								
							
						
					
					
						commit
						d496091107
					
				| @ -0,0 +1,23 @@ | ||||
| Denon PMA-770 (and others) Arduino Control | ||||
| 
 | ||||
| # About | ||||
| 
 | ||||
| This project ultimately seeks to be a "logic control" modification for a  | ||||
| Denon PMA-770; allowing one to do things like change inputs, volume,  | ||||
| balance, and tone using a remote control. | ||||
| 
 | ||||
| But that's a long ways down the road; so right now it's goal is to drive  | ||||
| relays and a display to replace the source input switches and input  | ||||
| display. I am designing it around the aforementioned Denon; but it can  | ||||
| obviously work for other units with some modification.  | ||||
| 
 | ||||
| Schematics and pictures up later. | ||||
| 
 | ||||
| # History | ||||
| 
 | ||||
| ``` | ||||
| 28-Dec-2019: Initial Version. Just reads five switches and triggers an  | ||||
| output. | ||||
| 29-Dec-2019: Added a display. Cleaned up code. Made a repository. | ||||
| ```` | ||||
| 
 | ||||
| @ -0,0 +1,74 @@ | ||||
| /*
 | ||||
|   Input Relay Alpha | ||||
| 
 | ||||
|   dewdude@gmail.com - 28-12-2019 | ||||
|    | ||||
|  */ | ||||
| 
 | ||||
| int latchPin = 11; | ||||
| int clockPin = 9; | ||||
| int dataPin = 12; | ||||
| int matrix = A0; | ||||
| 
 | ||||
| byte out = 0; | ||||
| int mx = 0; | ||||
| void updateShiftRegister() | ||||
| { | ||||
|    digitalWrite(latchPin,LOW); | ||||
|    shiftOut(dataPin, clockPin, LSBFIRST, out); | ||||
|    digitalWrite(latchPin, HIGH); | ||||
| } | ||||
| void setTape2() | ||||
| { | ||||
|   bitSet(out,5); | ||||
|   updateShiftRegister(); | ||||
| } | ||||
| void setTape1() | ||||
| { | ||||
|   bitSet(out,4); | ||||
|   updateShiftRegister(); | ||||
| } | ||||
| void setAUX() | ||||
| { | ||||
|   bitSet(out,3); | ||||
|   updateShiftRegister(); | ||||
| } | ||||
| void setTune() | ||||
| { | ||||
|   bitSet(out,2); | ||||
|   updateShiftRegister(); | ||||
| } | ||||
| void setPh1() | ||||
| { | ||||
|   bitSet(out,1); | ||||
|   updateShiftRegister(); | ||||
| } | ||||
| 
 | ||||
| void setup() | ||||
| { | ||||
|   pinMode(latchPin, OUTPUT); | ||||
|   pinMode(dataPin, OUTPUT);   | ||||
|   pinMode(clockPin, OUTPUT); | ||||
|   Serial.begin(9600); | ||||
|   Serial.print("Setting default output"); | ||||
|   bitSet(out,7); | ||||
|  updateShiftRegister(); | ||||
|  Serial.print("Scanning Matrix"); | ||||
| } | ||||
| 
 | ||||
| void loop() { | ||||
|   // put your main code here, to run repeatedly:
 | ||||
| int mx = analogRead(matrix); | ||||
|   if (mx > '100' && mx < '200') | ||||
|     {setTape2();} | ||||
|   if (mx > '500' && mx < '600') | ||||
|     {setTape1();} | ||||
|   if (mx > '900' && mx < '950') | ||||
|     {setAUX();} | ||||
|   if (mx > '1000') | ||||
|     {setTune();} | ||||
|   if (mx > '820' && mx < '899') | ||||
|     {setPh1();} | ||||
| Serial.println(mx); | ||||
| delay(200); | ||||
| } | ||||
					Loading…
					
					
				
		Reference in New Issue