Skip to content

Latest commit

 

History

History
36 lines (24 loc) · 963 Bytes

README.md

File metadata and controls

36 lines (24 loc) · 963 Bytes

this is my playground fro the Raspberry Pico rp2040

it uses to following hardware

MSH-4.0inch Display B

4x4 keypad

The goal is

  • use different pins for I2C0

This is done wir Earle Philhowers tools

access I2C with WIRE object on pin GPIO0 (SDA) and GPIO1 (SCL)

first declare usage of pins

  i2c_init(i2c_default, 100 * 1000);
  gpio_set_function(I2C_SDA, GPIO_FUNC_I2C);
  gpio_set_function(I2C_SCL, GPIO_FUNC_I2C);
  gpio_pull_up(I2C_SDA);
  gpio_pull_up(I2C_SCL);

then change setup for Wire object and initialize

  Wire.setSDA(0);
  Wire.setSCL(1);

  Wire.begin();

for using with LEDs for blink, remember the PCF8574 pins are open collector! Writing a "1" means turning LED off. Because not all port pins are used, there seems to be some interference between the pins. Writing a zero to the PCF8574 didn't light up all LEDs on P0 to P4. First pulling all unused pins to 3V3 corrects this behavior.