knightrider is working on PCF8574 8 IO expander (I only tested with 1 LED)
-----------------------------------------------------------------------
/*--------------------------------------------------------------
Program: two_wire_knight_rider
Description: Uses a PCF8574 IO Expander IC on the Arduino
TWI bus to interface 8 LEDs. A "knight
rider" display is shown on the LEDs.
Date: 25 April 2012
Author: W.A. Smith, http://startingelectronics.org
--------------------------------------------------------------*/
#include <Wire.h>
// address of PCF8574 IC on TWI bus
//#define IO_ADDR (0x38 >> 1)
#define IO_ADDR (0x38)
void setup() {
Wire.begin(0, 2); // initialize the I2C/TWI interface
Wire.setClock(50000); //this does nothing !!!! - it runs at 100000
Serial.begin(9600);
}
void loop() {
Serial.println("looping");
static unsigned char data = 0x01; // data to display on LEDs
static unsigned char direc = 1; // direction of knight rider display
// send the data to the LEDs
Wire.beginTransmission(IO_ADDR);
Wire.write(~data);
Wire.endTransmission();
delay(70); // speed of display
// shift the on LED in the specified direction
if (direc) {
data <<= 1;
}
else {
data >>= 1;
}
// see if a direction change is needed
if (data == 0x80) {
direc = 0;
}
if (data == 0x01) {
direc = 1;
}
}
------------------------------------------------------------------------------------------------
note the
//#define IO_ADDR (0x38 >> 1)
#define IO_ADDR (0x38)
0x38 is as found by the scanner program seems there is no need to remove a bit off the end
So my esp01 is working fine on SDA 2 and SCL 0 for both the scanner and the knightrider PCF8574
The Adafruit MCP23017 is more complex and I see that the cpp file contains
#include <avr/pgmspace.h>
So I think that means a special compile for the esp8266 is needed?
But I guess it ran in the Sketch Buffet?
I have yet to learn how to compile my own IDE - perhaps that was done for the Buffet?