Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Login


Options
View
Go to last post Go to first unread
gebi  
#1 Posted : Tuesday, September 14, 2010 12:43:04 AM(UTC)
gebi

Rank: Member

Groups: Member
Joined: 5/3/2008(UTC)
Posts: 1
Location: gebi

just started playing with my arduino Duemilanove (I’m newbie with it).
sadly I cannot get the volume control via I2c running with my buffalo 1 (will upgrade to the 2 dream later :-))
I known that is not a arduino list, but maybe I'm making here a stupid fundamental error.
the base code is take from hifiduino's side. does somebody have an email from him ?
I'm using the wire lib.

A few questions:
about wiring from arduino to buffalo:
pin 4 to sda
pin 5 to scl
connect grounds.
Is it needed to connect Vdd on the buffalo too - on the arduino I have 3.3V
and do we need pull up resistors (I don't think so as the pull up res are in the buffalo 1 already ) ?
after that I tried the following test program to attenuate the vol.
but nothing happens — but the ‘build in LED’ from the arduino is flashing.
thanks

gebi
————————————————————————————–
#include
int ledPin = 13; // led on the arduino
int vol=0;
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
}
void loop()
{
// Do stuff repeatedly
digitalWrite(ledPin, LOW); // set the LED on
delay(1000);
Wire.beginTransmission(0×80); // Address of DAC is hex 80
Wire.send(0×01); // Address of register 1 is hex 1
Wire.send(vol); // Value into register 40
Wire.send(0×02); // Address of register 2 is hex 2
Wire.send(vol); // Value into register 40
Wire.send(0×03); // Address of register 3 is hex 3
Wire.send(vol); // Value into register 40
Wire.send(0×04); // Address of register 4 is hex4
Wire.send(vol); // Value into register 40
Wire.endTransmission();
digitalWrite(ledPin, HIGH);
delay(1000);
vol=vol+8; // 64 steps to 0.5db each. max attenuation=-127db
if(vol == 64) // if reached 64th position (max)
{
vol = 0; // start over from 0db
}
}
Rss Feed  Atom Feed
Users browsing this topic
GuestUser (2)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.