Hello!
I am working on a small project where I try to control two LED's from a output pin of an PCF8574N. For those of you who don't know, this is a I2C I/O port extender.
Iv'e got everything working except for the power of the LED's is very low. When I measure the output in line with the resistor and LED I get 0.07mA and the LED is very weak. It normally draws about 0.7mA.
It is not the voltage that is wrong, when I measure the output without any load it supplies +5V
Any one have any idea of what is wrong?
I've supplied my schematics, data sheet and the current code as well:
http://www.mouser.com/ds/2/405/pcf8574-556842.pdf
#include<Wire.h>
byte x=0;
byte y=0;
void setup()
{
Wire.begin();
//Serial.begin(9600);
}
void loop()
{
Wire.requestFrom(0x22,1);
if(Wire.available()) //If the request is available
{
x=Wire.read(); //Receive the data
Serial.println(x);
}
if(x<255) //If the data is less than 255
{
if (x==1) { y = 4; }; //P0
if (x==2) { y = 8; }; //P1
//if (x==247) { y = 8; }; //P3
//if (x==251) { y = 4; }; //P2
}
Wire.beginTransmission(0x22); //Begin the transmission to PCF8574
Wire.write(y); //Send the data to PCF8574
Wire.endTransmission(); //End the Transmission
}
Best regards
Kalf