I dont have an UNO, but I'll try to look into it this weekend; i have some atmega328 chips i can put to use.
I think the arduino UNO R3 A4 A5 pins are on pins 4 and 5 of Port C so you'd have to change the code to reflect the following pins and ports:
#define SCL_PIN 5 //Arduino UNO R3???
#define SCL_PORT PORTC
#define SDA_PIN 4 //Arduino UNO R3???
#define SDA_PORT PORTC
//AND ALSO COMMENT OUT THE PIN MODES
//SETUP I2C INPUT PINS
//pinMode(27,INPUT_PULLUP);
//pinMode(28,INPUT_PULLUP);
Arduino UNO R3 Pins 16/17 are PB2 and PB3 respectively, that would be Port B pins 2 and 3.
Give that a shot, if still no luck let me know and i'll see what i can put together.
EDIT: you will need to use 4.7k-ohm pull up resistors to 3.3v[/QUOTE
I dont have an UNO, but I'll try to look into it this weekend; i have some atmega328 chips i can put to use.
I think the arduino UNO R3 A4 A5 pins are on pins 4 and 5 of Port C so you'd have to change the code to reflect the following pins and ports:
#define SCL_PIN 5 //Arduino UNO R3???
#define SCL_PORT PORTC
#define SDA_PIN 4 //Arduino UNO R3???
#define SDA_PORT PORTC
//AND ALSO COMMENT OUT THE PIN MODES
//SETUP I2C INPUT PINS
//pinMode(27,INPUT_PULLUP);
//pinMode(28,INPUT_PULLUP);
Arduino UNO R3 Pins 16/17 are PB2 and PB3 respectively, that would be Port B pins 2 and 3.
Give that a shot, if still no luck let me know and i'll see what i can put together.
EDIT: you will need to use 4.7k-ohm pull up resistors to 3.3v
I'm a complete new comer to Arduino. This will be my first project. I have an Arduino UNO r3 with a surface mount Atmega 328p on it. I have the software and the Serial USB is working (tested with the blink sketch). I want to test 11.1v laptop batteries (3 Lipo cells in series). I know that the data output terminals on my batteries work with 3.3v. I am a bit of an electronics freak so I have plenty of 4,7k ohm resistors lying around. I usually don't hook anything up until I'm convinced that I know what I'm doing, especially with power levels that could blow up my new Arduino. There's a slightly confusing schematic posted here that shows SDA and SCL with pull up resistors to +VCC. It doesn't specify which +VCC but I'm assuming in my case that would be the one labeled 3.3v on my Arduino board. The other end is going to B1 and B4 (whatever that’s supposed to be). I'm thinking it should be the SB data and clock lines coming from my battery. My batteries have 9 wires on pin connectors, three are black and three are red; those are the + and – terminals. There’s a brown wire which is the battery present sensor, which allows output when connected to ground. The other two (yellow and blue) are probably the battery data and clock wires. They show up as 3.3v on the computer’s motherboard. I downloaded your sketch and the modifications you're talking about are already included. I'm really confused about the pin and port labeling. Looking at the Atmega chip, the pinout does not correspond to the numbering on the Arduino board. I too have 0 to 17 on the PWM side with 16 and 17 labeled SDA and SDL. I don't know how that translates to Pin5 or portC or Pin2 portB but I guess that isn't important as long as it works. I'm assuming these sockets need to be connected via pull up resistors with the socket labeled 3.3v on the power side of the Arduino board. In addition, the side before the pull up resistor would connect to the battery's data output lines. Ground should be connected to battery ground. Of course, there are several grounds to choose from on the Arduino board. I'm assuming they're all connected together. This also means that the Arduino ground (which is coming from my laptop's USB port) is indirectly connected to mains ground through the laptop’s switch mode power supply. I'm also assuming that I don't need to hook up the battery positive (+11.1v) to the Arduino at all because the data lines will also give me a readout of the voltage. Can you verify all of this and correct me where I'm wrong so I don't have to go around assuming things that I really should know before I start this project. Thanks in advance ;-)