Rank: Member
Groups: Member
Joined: 3/21/2013(UTC) Posts: 3 Location: NYC
|
Hi Russ, Where do I put the resistor when using OTTO S - level converter - Arduino digital pin for control? I did a bit of practice work with the Arduino code and figured out how to change it to work with the OTTO and MUX with the hifiduino code. Now I just have to get the white apple remote I have to work with all of it's buttons. I was able to change the code to get the MUX and the OTTO hooked up and working so that they switch with the input changes with the hifiduino code. I am using a 5 volt to 3.3 volt level converter (same one I am using for the i2c connection for the buffalo II) to connect the OTTO, and direct 5 volts for the MUX. My setup is the 4/1 MUX to i2s into OTTO, an Amanero USB i2s into OTTO, and OTTO into Buffalo II. Here is how I modified the code, in case someone else wants to do this as well. Hopefully this will help. Line numbers are tricky in the Arduino IDE. To find the line number, look at the bottom. The line number of the cursor is displayed. I decided to use analog pins A0, A1, and A2 on the Arduino Uno to control the OTTO and the MUX. Two pins for the MUX, and one for the OTTO. They can also be used as digital pins 14, 15, and 16 respectively. I connected pins 14 and 15 to MUX control 0 and 1, and pin 16 to the 5 volt side of the level converter, and the 3.3 volt side to OTTO S. I also connected the GND connection on the MUX control to the GND on the Arduino. At line 1220, I added code to make the analog pins digital output pins on the arduino. pinMode(14, OUTPUT) pinMode(15, OUTPUT) pinMode(16, OUTPUT) Then under each input, I set the pins to LOW or HIGH so that the correct input would be selected. On HIGH, the pin outputs 5 volts. On LOW, the pin outputs close to 0 volts. Testing the circuit with LCD's confirmed that the once a pin is set to HIGH or LOW, it will stay there unless it is told to change on the following input. I made sure to turn off pins that I did not need on for each input. Here is how I modified the code to turn the pins on and off to switch the MUX and OTTO. The digitalWrite() lines are the ones that I added. The first two inputs set the OTTO to output the Amanero. The third sets the OTTO to the side with the MUX, and selects input 1 on the MUX. Then input 2, then 3, then back to the Amanero again. case 0: lcd.print(no0); digitalWrite(16, LOW); break; case 1: lcd.print(no1); digitalWrite(16, LOW); break; case 2: lcd.print(no2); digitalWrite(16, HIGH); digitalWrite(14, LOW); digitalWrite(15, LOW); break; case 3: lcd.print(no3); digitalWrite(16, HIGH); digitalWrite(14, HIGH); digitalWrite(15, LOW); break; case 4: lcd.print(no4); digitalWrite(16, HIGH); digitalWrite(14, LOW); digitalWrite(15, HIGH); break; case 5: lcd.print(no5); digitalWrite(16, LOW); digitalWrite(15, LOW); digitalWrite(14, LOW); break; Edited by user Thursday, May 16, 2013 2:48:45 AM(UTC)
| Reason: added that I connected GND from MUX control to arduino
|