Particle Photon, controlling a PCF8574 via I2C- works on Arduino

I’m trying to reed and control some buttons and LEDs on a Bang & Olufsen infrared eye. It uses a pcf8574 microcontroller to control 2 LEDs and 4 buttons. First of all I just want to get the LEDs to blink. I have successfully done that with an Arduino Uno.

But I want to use it with an Particle Photon so I can connected to the internet. Here I have the code that worked on the Arduino:

#include <Wire.h>
#define beolink (B0100000) 

void setup() {
    Wire.begin();
}

void loop() {
    Wire.beginTransmission(beolink);
    Wire.write(0b11111111);
    Wire.endTransmission();
    delay(1000);
    Wire.beginTransmission(beolink);
    Wire.write(0b00111111);
    Wire.endTransmission();
    delay(1000);
} 

I have no errors on the Particle Photon. I have also tried switching cables and tried 5v instead of the 3.3v. I have connected the pins on the Particle Photon to the same as on the Arduino [SCL(D1) & SDA(D0)]. I really hope someone can help me out by getting this to work on a Particle Photon. Thanks :slight_smile:

Unlike Arduino boards Particle boards don’t bring their own I2C pull-up resistors on the I2C pins.
If your PCF8574 doesn’t provide them either you need to add them.

How and where?

Can you share the schematics and/or a photo of your setup?

BTW, you should use the common C/C++ notation 0b0100000 for your #define beolink instead of the Arduino specific B0100000.

1 Like

Thank you so much!!! Now it works! You have no idea how long i have been trying to get this to work. Thank you again!!

1 Like