Adafruit_Seesaw icon indicating copy to clipboard operation
Adafruit_Seesaw copied to clipboard

Calling digitalReadBulk before analogRead causes analogRead to return 1024

Open sdunlap opened this issue 1 year ago • 0 comments

This is a minor issue and may be hardware-dependent. If you call digitalReadBulk() immediately before calling analogRead(), the analogRead() will almost always return 1024. Adding delay(1); between the commands fixes the issue. In Adafruit_seesaw.cpp, there is a delay at the end of the analogRead() functions, but not digitalReadBulk().

  • Feather RP2040 with RFM95 LoRa
  • Joy FeatherWing
  • Arduino IDE version: 2.2.1

Steps to reproduce:

  1. Open joy_featherwing_example.ino
  2. Move ss.digitalReadBulk(button_mask) to just before ss.analogRead(2)
void loop() {
  uint32_t buttons = ss.digitalReadBulk(button_mask);
  int x = ss.analogRead(2);
  int y = ss.analogRead(3);
  ....
}

joy_featherwing_example.ino.txt

sdunlap avatar Oct 27 '23 20:10 sdunlap