I Will Pay You to Fix my Code and Make This Sketch Work

Hi, everyone. I am so very frustrated with my inability to understand how this sketch is failing me. I have a Fritzing image at this link: https://dctech.tech/?page_id=500

I have removed all ez-button references, and I am just treating this like five “bouncing” inputs. Based on my sketch, pressing one of the five switches (grounding) D3, D6, D8, D9, or D10 should display an appropriate message on the SSD1306.

My problem is that inputs D3 and D6 just don’t work. Worse, adding a switch to D1 (which is not even declared) activates the down switch function.

I am very happy, at this point, to pay someone with a XIAO ESP32C3 and display and some momentary contact switches for their time to make this sketch work.

BTW - This sketch works great with my XIAO SAMD21, just not the ESP32C3, but I need Bluetooth capabilities.

/*  This simple sketch demonstrates my ignorance of the ESP32C3 architecture.  I extracted this code from a longer, functioning sketch for
 *  a XIAO SAMD21.  I have left out the ezbutton commands for simplicity so, of course, there are bounce issues.  That is not my problem.
 *  There is a Fritzing image accompanying this sketch.  According to the sketch (IMHO), pushing any of the buttons 
 *  connected to thefive digital inputs should trip the is fstatement and display one of five responses.  The problem is, D3 and D6 do NOT
 *  respond to the digital inputs (taken LOW with a HIGH pullup).  Worse yet, pressing the "ghost switch" in the Fritzing image drives
 *  digital pin D! low and activates the function otherwise controlled by the D6 input.
 *  
 *  My Questions:
 *  1)  How can I make this sketch work for the D3 and D6 inputs?
 *  2)  Why does grounding D1 activate the function that D6 is supposed to control?
 *  
 *  Thank you to anyone who solves this.  Please send a copy of the corrected sketch to: [email protected]
  */
  
const int upButton = 6;  // Up Button
const int downButton = 3;  // Down Button
const int resetButton = 8;  // Enter Button
const int leftButton = 10;  // Left Button
const int rightButton = 9;  // Right Button

#include "Wire.h"
#include <Adafruit_GFX.h>                     // Calls up the OLED graphics folder.
#include <fonts/Org_01.h>
#include <Adafruit_SSD1306.h>                 // Calls up the OLED display folder.       // Holds the angular information.

#define OLED_RESET -1
Adafruit_SSD1306 display(OLED_RESET);
#define LOGO16_GLCD_HEIGHT 32                  // Sets the display to 032 bits high
#define LOGO16_GLCD_WIDTH  128                 // Sets the display to 128 bits long

void i2cSetup() {
  // join I2C bus
#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE
  Wire.begin();
#elif I2CDEV_IMPLEMENTATION == I2CDEV_BUILTIN_FASTWIRE
  Fastwire::setup(400, true);
#endif
}


void setup() 
{
  // initialize digital pins as inputs.
 pinMode(resetButton, INPUT_PULLUP);     // Initialize the pushbutton pin 9 as an input pullup . . .
 pinMode(upButton, INPUT_PULLUP);        // Initialize the pushbutton pin 10 as an input pullup . . .
 pinMode(downButton, INPUT_PULLUP);      // Initialize the pushbutton pin 8 as an input pullup . . .
 pinMode(leftButton, INPUT_PULLUP);      // Initialize the pushbutton pin 3 as an input pullup . . .
 pinMode(rightButton, INPUT_PULLUP);     // Initialize the pushbutton pin 6 as an input pullup . . .

  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
  display.clearDisplay();

  
   while((digitalRead(resetButton) == HIGH ) and (digitalRead(upButton) == HIGH ) and (digitalRead(downButton) == HIGH ) and (digitalRead(leftButton) == HIGH ) and (digitalRead(rightButton) == HIGH ))                              // Begin the instruction loop to operate the device.
  {
  display.clearDisplay();
  display.setTextSize(2);
  display.setTextColor(WHITE);
  display.setCursor(0,0);
  display.clearDisplay();
  display.display();
  display.invertDisplay(false);
  display.print("Hold any  ");
  display.print("Button 4 #");
  display.display();
  if ((digitalRead(resetButton) == HIGH ) and (digitalRead(upButton) == HIGH ) and (digitalRead(downButton) == HIGH ) and (digitalRead(leftButton) == HIGH ) and (digitalRead(rightButton) == HIGH ))
  {delay(2000);}

  
  }                 // End of the WHILE instruction loop awaiting a data button push 
  for(int16_t i=0; i<display.height()/2; i+=2) {
  display.display();
  display.drawRect(i, i, display.width()-2*i, display.height()-2*i, SSD1306_WHITE);
}
}


// the loop function runs over and over again forever
void loop() {

 if ((digitalRead(resetButton) == LOW ) and (digitalRead(upButton) == HIGH ) and (digitalRead(downButton) == HIGH ) and (digitalRead(leftButton) == HIGH ) and (digitalRead(rightButton) == HIGH ))
{
  display.clearDisplay();
  display.setTextSize(2);
  display.setTextColor(WHITE);
  display.setCursor(0,0);
  display.clearDisplay();
  display.display();
  display.invertDisplay(false);
  display.print("Reset     Button    ");
  display.display();
}

 if ((digitalRead(resetButton) == HIGH) and (digitalRead(upButton) == LOW ) and (digitalRead(downButton) == HIGH ) and (digitalRead(leftButton) == HIGH ) and (digitalRead(rightButton) == HIGH ))
{
  display.clearDisplay();
  display.setTextSize(2);
  display.setTextColor(WHITE);
  display.setCursor(0,0);
  display.clearDisplay();
  display.display();
  display.invertDisplay(false);
  display.print("Up Button ");
  display.display();
}

 if ((digitalRead(resetButton) == HIGH ) and (digitalRead(upButton) == HIGH ) and (digitalRead(downButton) == LOW ) and (digitalRead(leftButton) == HIGH ) and (digitalRead(rightButton) == HIGH ))
{
  display.clearDisplay();
  display.setTextSize(2);
  display.setTextColor(WHITE);
  display.setCursor(0,0);
  display.clearDisplay();
  display.display();
  display.invertDisplay(false);
  display.print("Down      Button    ");
  display.display();
}

 if ((digitalRead(resetButton) == HIGH ) and (digitalRead(upButton) == HIGH ) and (digitalRead(downButton) == HIGH ) and (digitalRead(leftButton) == LOW ) and (digitalRead(rightButton) == HIGH ))
{
  display.clearDisplay();
  display.setTextSize(2);
  display.setTextColor(WHITE);
  display.setCursor(0,0);
  display.clearDisplay();
  display.display();
  display.invertDisplay(false);
  display.print("Left      Button    ");
  display.display();
}

 if ((digitalRead(resetButton) == HIGH ) and (digitalRead(upButton) == HIGH ) and (digitalRead(downButton) == HIGH ) and (digitalRead(leftButton) == HIGH ) and (digitalRead(rightButton) == LOW ))
{
  display.clearDisplay();
  display.setTextSize(2);
  display.setTextColor(WHITE);
  display.setCursor(0,0);
  display.clearDisplay();
  display.display();
  display.invertDisplay(false);
  display.print("Right     Button    ");
  display.display();
}

 
}

Hi there seems to compile ok here?
I did Update to ESP32c3 Alpha2 BSP prior.
HTH
GL :slight_smile: PJ
Output

FQBN: esp32:esp32:XIAO_ESP32C3
Using board 'XIAO_ESP32C3' from platform in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.0-alpha2
Using core 'esp32' from platform in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.0-alpha2

cmd /c if exist "C:\\Users\\Dude\\AppData\\Local\\Temp\\.arduinoIDE-unsaved2023922-14908-5g0f9d.i19s9\\sketch_oct22a\\partitions.csv" COPY /y "C:\\Users\\Dude\\AppData\\Local\\Temp\\.arduinoIDE-unsaved2023922-14908-5g0f9d.i19s9\\sketch_oct22a\\partitions.csv" "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\9449F4D87BD6E74A119684CE668D596F\\partitions.csv"
cmd /c if not exist "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\9449F4D87BD6E74A119684CE668D596F\\partitions.csv" if exist "C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\3.0.0-alpha2\\variants\\XIAO_ESP32C3\\partitions.csv" COPY "C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\3.0.0-alpha2\\variants\\XIAO_ESP32C3\\partitions.csv" "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\9449F4D87BD6E74A119684CE668D596F\\partitions.csv"
cmd /c if not exist "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\9449F4D87BD6E74A119684CE668D596F\\partitions.csv" COPY "C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\3.0.0-alpha2\\tools\\partitions\\default.csv" "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\9449F4D87BD6E74A119684CE668D596F\\partitions.csv"
cmd /c IF EXIST "C:\\Users\\Dude\\AppData\\Local\\Temp\\.arduinoIDE-unsaved2023922-14908-5g0f9d.i19s9\\sketch_oct22a\\bootloader.bin" ( COPY /y "C:\\Users\\Dude\\AppData\\Local\\Temp\\.arduinoIDE-unsaved2023922-14908-5g0f9d.i19s9\\sketch_oct22a\\bootloader.bin" "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\9449F4D87BD6E74A119684CE668D596F\\sketch_oct22a.ino.bootloader.bin" ) ELSE ( IF EXIST "C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\3.0.0-alpha2\\variants\\XIAO_ESP32C3\\bootloader.bin" ( COPY "C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\3.0.0-alpha2\\variants\\XIAO_ESP32C3\\bootloader.bin" "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\9449F4D87BD6E74A119684CE668D596F\\sketch_oct22a.ino.bootloader.bin" ) ELSE ( "C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esptool_py\\4.6/esptool.exe" --chip esp32c3 elf2image --flash_mode dio --flash_freq 80m --flash_size 4MB -o "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\9449F4D87BD6E74A119684CE668D596F\\sketch_oct22a.ino.bootloader.bin" "C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.1-6b1f40b9bf/esp32c3\\bin\\bootloader_qio_80m.elf" ) )
esptool.py v4.6
Creating esp32c3 image...
Merged 1 ELF section
Successfully created esp32c3 image.
cmd /c if exist "C:\\Users\\Dude\\AppData\\Local\\Temp\\.arduinoIDE-unsaved2023922-14908-5g0f9d.i19s9\\sketch_oct22a\\build_opt.h" COPY /y "C:\\Users\\Dude\\AppData\\Local\\Temp\\.arduinoIDE-unsaved2023922-14908-5g0f9d.i19s9\\sketch_oct22a\\build_opt.h" "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\9449F4D87BD6E74A119684CE668D596F\\build_opt.h"
cmd /c if not exist "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\9449F4D87BD6E74A119684CE668D596F\\build_opt.h" type nul > "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\9449F4D87BD6E74A119684CE668D596F\\build_opt.h"
Detecting libraries used...
C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\tools\esp-rv32\2302/bin/riscv32-esp-elf-g++ -c @C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-6b1f40b9bf/esp32c3/flags/cpp_flags -w -Os -w -x c++ -E -CC -DF_CPU=160000000L -DARDUINO=10607 -DARDUINO_XIAO_ESP32C3 -DARDUINO_ARCH_ESP32 -DARDUINO_BOARD="XIAO_ESP32C3" -DARDUINO_VARIANT="XIAO_ESP32C3" -DARDUINO_PARTITION_default -DARDUINO_HOST_OS="windows" -DARDUINO_FQBN="esp32:esp32:XIAO_ESP32C3:UploadSpeed=921600,CDCOnBoot=default,CPUFreq=160,FlashFreq=80,FlashMode=qio,FlashSize=4M,PartitionScheme=default,DebugLevel=none,EraseFlash=none" -DESP32 -DCORE_DEBUG_LEVEL=0 -DARDUINO_USB_MODE=1 -DARDUINO_USB_CDC_ON_BOOT=1 @C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-6b1f40b9bf/esp32c3/flags/defines -IC:\Users\Dude\AppData\Local\Temp\.arduinoIDE-unsaved2023922-14908-5g0f9d.i19s9\sketch_oct22a -iprefix C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-6b1f40b9bf/esp32c3/include/ @C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-6b1f40b9bf/esp32c3/flags/includes -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-6b1f40b9bf/esp32c3/qio_qspi/include -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.0-alpha2\cores\esp32 -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.0-alpha2\variants\XIAO_ESP32C3 @C:\Users\Dude\AppData\Local\Temp\arduino\sketches\9449F4D87BD6E74A119684CE668D596F/build_opt.h C:\Users\Dude\AppData\Local\Temp\arduino\sketches\9449F4D87BD6E74A119684CE668D596F\sketch\sketch_oct22a.ino.cpp -o nul
Alternatives for Wire.h: [[email protected]]
ResolveLibrary(Wire.h)
  -> candidates: [[email protected]]
C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\tools\esp-rv32\2302/bin/riscv32-esp-elf-g++ -c @C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-6b1f40b9bf/esp32c3/flags/cpp_flags -w -Os -w -x c++ -E -CC -DF_CPU=160000000L -DARDUINO=10607 -DARDUINO_XIAO_ESP32C3 -DARDUINO_ARCH_ESP32 -DARDUINO_BOARD="XIAO_ESP32C3" -DARDUINO_VARIANT="XIAO_ESP32C3" -DARDUINO_PARTITION_default -DARDUINO_HOST_OS="windows" -DARDUINO_FQBN="esp32:esp32:XIAO_ESP32C3:UploadSpeed=921600,CDCOnBoot=default,CPUFreq=160,FlashFreq=80,FlashMode=qio,FlashSize=4M,PartitionScheme=default,DebugLevel=none,EraseFlash=none" -DESP32 -DCORE_DEBUG_LEVEL=0 -DARDUINO_USB_MODE=1 -DARDUINO_USB_CDC_ON_BOOT=1 @C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-6b1f40b9bf/esp32c3/flags/defines -IC:\Users\Dude\AppData\Local\Temp\.arduinoIDE-unsaved2023922-14908-5g0f9d.i19s9\sketch_oct22a -iprefix C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-6b1f40b9bf/esp32c3/include/ @C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-6b1f40b9bf/esp32c3/flags/includes -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-6b1f40b9bf/esp32c3/qio_qspi/include -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.0-alpha2\cores\esp32 -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.0-alpha2\variants\XIAO_ESP32C3 -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.0-alpha2\libraries\Wire\src @C:\Users\Dude\AppData\Local\Temp\arduino\sketches\9449F4D87BD6E74A119684CE668D596F/build_opt.h C:\Users\Dude\AppData\Local\Temp\arduino\sketches\9449F4D87BD6E74A119684CE668D596F\sketch\sketch_oct22a.ino.cpp -o nul
Alternatives for Adafruit_GFX.h: [Adafruit GFX [email protected]]
ResolveLibrary(Adafruit_GFX.h)
  -> candidates: [Adafruit GFX [email protected]]
C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\tools\esp-rv32\2302/bin/riscv32-esp-elf-g++ -c @C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-6b1f40b9bf/esp32c3/flags/cpp_flags -w -Os -w -x c++ -E -CC -DF_CPU=160000000L -DARDUINO=10607 -DARDUINO_XIAO_ESP32C3 -DARDUINO_ARCH_ESP32 -DARDUINO_BOARD="XIAO_ESP32C3" -DARDUINO_VARIANT="XIAO_ESP32C3" -DARDUINO_PARTITION_default -DARDUINO_HOST_OS="windows" -DARDUINO_FQBN="esp32:esp32:XIAO_ESP32C3:UploadSpeed=921600,CDCOnBoot=default,CPUFreq=160,FlashFreq=80,FlashMode=qio,FlashSize=4M,PartitionScheme=default,DebugLevel=none,EraseFlash=none" -DESP32 -DCORE_DEBUG_LEVEL=0 -DARDUINO_USB_MODE=1 -DARDUINO_USB_CDC_ON_BOOT=1 @C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-6b1f40b9bf/esp32c3/flags/defines -IC:\Users\Dude\AppData\Local\Temp\.arduinoIDE-unsaved2023922-14908-5g0f9d.i19s9\sketch_oct22a -iprefix C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-6b1f40b9bf/esp32c3/include/ @C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-6b1f40b9bf/esp32c3/flags/includes -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-6b1f40b9bf/esp32c3/qio_qspi/include -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.0-alpha2\cores\esp32 -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.0-alpha2\variants\XIAO_ESP32C3 -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.0-alpha2\libraries\Wire\src -Id:\Arduino_projects\libraries\Adafruit_GFX_Library @C:\Users\Dude\AppData\Local\Temp\arduino\sketches\9449F4D87BD6E74A119684CE668D596F/build_opt.h C:\Users\Dude\AppData\Local\Temp\arduino\sketches\9449F4D87BD6E74A119684CE668D596F\sketch\sketch_oct22a.ino.cpp -o nul
Alternatives for Adafruit_I2CDevice.h: [Adafruit [email protected]]
ResolveLibrary(Adafruit_I2CDevice.h)
  -> candidates: [Adafruit [email protected]]
C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\tools\esp-rv32\2302/bin/riscv32-esp-elf-g++ -c @C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-6b1f40b9bf/esp32c3/flags/cpp_flags -w -Os -w -x c++ -E -CC -DF_CPU=160000000L -DARDUINO=10607 -DARDUINO_XIAO_ESP32C3 -DARDUINO_ARCH_ESP32 -DARDUINO_BOARD="XIAO_ESP32C3" -DARDUINO_VARIANT="XIAO_ESP32C3" -DARDUINO_PARTITION_default -DARDUINO_HOST_OS="windows" -DARDUINO_FQBN="esp32:esp32:XIAO_ESP32C3:UploadSpeed=921600,CDCOnBoot=default,CPUFreq=160,FlashFreq=80,FlashMode=qio,FlashSize=4M,PartitionScheme=default,DebugLevel=none,EraseFlash=none" -DESP32 -DCORE_DEBUG_LEVEL=0 -DARDUINO_USB_MODE=1 -DARDUINO_USB_CDC_ON_BOOT=1 @C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-6b1f40b9bf/esp32c3/flags/defines -IC:\Users\Dude\AppData\Local\Temp\.arduinoIDE-unsaved2023922-14908-5g0f9d.i19s9\sketch_oct22a -iprefix C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-6b1f40b9bf/esp32c3/include/ @C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-6b1f40b9bf/esp32c3/flags/includes -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-6b1f40b9bf/esp32c3/qio_qspi/include -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.0-alpha2\cores\esp32 -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.0-alpha2\variants\XIAO_ESP32C3 -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.0-alpha2\libraries\Wire\src -Id:\Arduino_projects\libraries\Adafruit_GFX_Library -Id:\Arduino_projects\libraries\Adafruit_BusIO @C:\Users\Dude\AppData\Local\Temp\arduino\sketches\9449F4D87BD6E74A119684CE668D596F/build_opt.h C:\Users\Dude\AppData\Local\Temp\arduino\sketches\9449F4D87BD6E74A119684CE668D596F\sketch\sketch_oct22a.ino.cpp -o nul
Alternatives for SPI.h: [[email protected]]
ResolveLibrary(SPI.h)
  -> candidates: [[email protected]]
C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\tools\esp-rv32\2302/bin/riscv32-esp-elf-g++ -c @C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-6b1f40b9bf/esp32c3/flags/cpp_flags -w -Os -w -x c++ -E -CC -DF_CPU=160000000L -DARDUINO=10607 -DARDUINO_XIAO_ESP32C3 -DARDUINO_ARCH_ESP32 -DARDUINO_BOARD="XIAO_ESP32C3" -DARDUINO_VARIANT="XIAO_ESP32C3" -DARDUINO_PARTITION_default -DARDUINO_HOST_OS="windows" -DARDUINO_FQBN="esp32:esp32:XIAO_ESP32C3:UploadSpeed=921600,CDCOnBoot=default,CPUFreq=160,FlashFreq=80,FlashMode=qio,FlashSize=4M,PartitionScheme=default,DebugLevel=none,EraseFlash=none" -DESP32 -DCORE_DEBUG_LEVEL=0 -DARDUINO_USB_MODE=1 -DARDUINO_USB_CDC_ON_BOOT=1 @C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-6b1f40b9bf/esp32c3/flags/defines -IC:\Users\Dude\AppData\Local\Temp\.arduinoIDE-unsaved2023922-14908-5g0f9d.i19s9\sketch_oct22a -iprefix C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-6b1f40b9bf/esp32c3/include/ @C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-6b1f40b9bf/esp32c3/flags/includes -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-6b1f40b9bf/esp32c3/qio_qspi/include -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.0-alpha2\cores\esp32 -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.0-alpha2\variants\XIAO_ESP32C3 -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.0-alpha2\libraries\Wire\src -Id:\Arduino_projects\libraries\Adafruit_GFX_Library -Id:\Arduino_projects\libraries\Adafruit_BusIO -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.0-alpha2\libraries\SPI\src @C:\Users\Dude\AppData\Local\Temp\arduino\sketches\9449F4D87BD6E74A119684CE668D596F/build_opt.h C:\Users\Dude\AppData\Local\Temp\arduino\sketches\9449F4D87BD6E74A119684CE668D596F\sketch\sketch_oct22a.ino.cpp -o nul
Alternatives for Adafruit_SSD1306.h: [Adafruit [email protected]]
ResolveLibrary(Adafruit_SSD1306.h)
  -> candidates: [Adafruit [email protected]]
C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\tools\esp-rv32\2302/bin/riscv32-esp-elf-g++ -c @C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-6b1f40b9bf/esp32c3/flags/cpp_flags -w -Os -w -x c++ -E -CC -DF_CPU=160000000L -DARDUINO=10607 -DARDUINO_XIAO_ESP32C3 -DARDUINO_ARCH_ESP32 -DARDUINO_BOARD="XIAO_ESP32C3" -DARDUINO_VARIANT="XIAO_ESP32C3" -DARDUINO_PARTITION_default -DARDUINO_HOST_OS="windows" -DARDUINO_FQBN="esp32:esp32:XIAO_ESP32C3:UploadSpeed=921600,CDCOnBoot=default,CPUFreq=160,FlashFreq=80,FlashMode=qio,FlashSize=4M,PartitionScheme=default,DebugLevel=none,EraseFlash=none" -DESP32 -DCORE_DEBUG_LEVEL=0 -DARDUINO_USB_MODE=1 -DARDUINO_USB_CDC_ON_BOOT=1 @C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-6b1f40b9bf/esp32c3/flags/defines -IC:\Users\Dude\AppData\Local\Temp\.arduinoIDE-unsaved2023922-14908-5g0f9d.i19s9\sketch_oct22a -iprefix C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-6b1f40b9bf/esp32c3/include/ @C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-6b1f40b9bf/esp32c3/flags/includes -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-6b1f40b9bf/esp32c3/qio_qspi/include -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.0-alpha2\cores\esp32 -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.0-alpha2\variants\XIAO_ESP32C3 -

**EDIT____for brevity____**

Using library Wire at version 2.0.0 in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.0-alpha2\libraries\Wire 
Using library Adafruit GFX Library at version 1.11.9 in folder: D:\Arduino_projects\libraries\Adafruit_GFX_Library 
Using library Adafruit BusIO at version 1.14.5 in folder: D:\Arduino_projects\libraries\Adafruit_BusIO 
Using library SPI at version 2.0.0 in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.0-alpha2\libraries\SPI 
Using library Adafruit SSD1306 at version 2.5.7 in folder: D:\Arduino_projects\libraries\Adafruit_SSD1306 
"C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp-rv32\\2302/bin/riscv32-esp-elf-size" -A "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\9449F4D87BD6E74A119684CE668D596F/sketch_oct22a.ino.elf"
Sketch uses 252552 bytes (19%) of program storage space. Maximum is 1310720 bytes.
Global variables use 9340 bytes (2%) of dynamic memory, leaving 318340 bytes for local variables. Maximum is 327680 bytes.

Thank you so much for trying it out but my problem is in the operation, not the compiling. Did you actually assemble a breadboard to test D3 and D6? They are my problem children.

I got this to go here…


Jumper from gnd to pin2(GPIO3) , pin5(GPIO6), etc, 7,8,9 all appear to work.
the built in button on the expansion board also works for down button.
here’s the video?

HTH
GL :slight_smile: PJ

Try this…

const int upButton = D6;  // Up Button
const int downButton = D3;  // Down Button
const int resetButton = D8;  // Enter Button
const int leftButton = D10;  // Left Button
const int rightButton = D9;  // Right Button

Thanks, the pins needed to be designated DO, D1, not 0, 1, etc. I called them correctly by name but didn’t designate them the same way in my code.

Thanks, you also called it correcltly. I wasn’t using the “D” when calling up a digital pin so some worked and some failed. Go figure.

Respectfully - Baran