Hi there!
I recently swapped in a brand new Nano 33 BLE (Rev 2) board to my project in place of one that I previously damaged. I'm uploading one of the most basic sketches imaginable, which flashes the onboard LED a few times during startup and then leaves it set to a particular color. I used to set it to blue on the old board, but when I uploaded the sketch to this new board, it illuminated green! Setting the LED to green instead now makes it light up blue.
I've tried every code verification I can think of for the onboard LED RGB pin constants and it appears that the two pin numbers for the onboard LED green and blue (23 and 24, respectively -- https://support.arduino.cc/hc/en-us/articles/360016724140-Control-the-RGB-LED-on-Nano-33-BLE-boards) are simply behaving swapped in the hardware. LEDR (22) still illuminates the LED red as it should, which is equally puzzling to me given that blue and green are swapped.
To summarize, the behavior seems to go as follows:
digitalWrite(LEDR, LOW) -> Onboard LED illuminates RED
digitalWrite(LEDG, LOW) -> Onboard LED illuminates BLUE
digitalWrite(LEDB, LOW) -> Onboard LED illuminates GREEN
The only modifications I've made to the board are soldering on the included headers and cutting the 3.3V jumper in conjunction with supplying the board from a 3.3V LDO voltage regulator. Below is the sketch that produces a BLUE onboard LED after start-up:
void setup() {
pinMode(LEDR, OUTPUT);
pinMode(LEDG, OUTPUT);
pinMode(LEDB, OUTPUT);
for (int i = 0; i < 5; i++) {
digitalWrite(LEDR, LOW);
digitalWrite(LEDG, LOW);
delay(100);
digitalWrite(LEDR, HIGH);
digitalWrite(LEDG, HIGH);
delay(100);
}
long start_millis = millis();
Serial.begin(9600);
while (!Serial) {
if (millis() - start_millis > 5000) {
break;
}
delay(50);
}
Serial.print("Started up Woody sensor module (took ");
Serial.print((millis() - start_millis) / 1000.0);
Serial.println(" seconds)");
digitalWrite(22, HIGH);
digitalWrite(23, HIGH);
digitalWrite(24, HIGH);
digitalWrite(LEDG, LOW);
// digitalWrite(LEDB, LOW);
analogReadResolution(12);
}
void loop() {
Serial.println(millis());
delay(1000);
}
Any ideas as to what could explain this? Could a stray cutting stroke with my utility knife while severing the 3.3V jumper or perhaps some header soldering error (excess / prolonged heat?) possibly lead to this color swap? I would think a mechanical mistake such as that would make either all/none of the pins work (or all 3 would be incorrect), and also that said pins are so internal to the board that they would not be easily swapped like this from some external mistake. Thanks in advance for any thoughts you have!
Best,
Daniel