First tried with my new Board

Hello,

I just received my nano BLE 33 board. After having set up the Arduino IDE I started to Upload 2 different examples: Blink & Micro-speech. Both examples were uploaded successful. The problem is that it does not do anything special:

1 - The blink example just shows the power led (Green). 2 - The micro speech example just showed the Green + White led (Should change the led color when saying "Yes" right?)

Do these samples fit the nano ble 33 board?

Any idea what can be wrong?

Below the log of the upload process:

Sketch uses 145352 bytes (14%) of program storage space. Maximum is 983040 bytes. Global variables use 76952 bytes (29%) of dynamic memory, leaving 185192 bytes for local variables. Maximum is 262144 bytes. Device : nRF52840-QIAA Version : Arduino Bootloader (SAM-BA extended) 2.0 [Arduino:IKXYZ] Address : 0x0 Pages : 256 Page Size : 4096 bytes Total Size : 1024KB Planes : 1 Lock Regions : 0 Locked : none Security : false Erase flash

Done in 0.000 seconds Write 145360 bytes to flash (36 pages)

[ ] 0% (0/36 pages) [= ] 5% (2/36 pages) [== ] 8% (3/36 pages) [=== ] 11% (4/36 pages) [==== ] 13% (5/36 pages) [===== ] 16% (6/36 pages) [===== ] 19% (7/36 pages) [====== ] 22% (8/36 pages) [======= ] 25% (9/36 pages) [======== ] 27% (10/36 pages) [========= ] 30% (11/36 pages) [========== ] 33% (12/36 pages) [========== ] 36% (13/36 pages) [=========== ] 38% (14/36 pages) [============ ] 41% (15/36 pages) [============= ] 44% (16/36 pages) [============== ] 47% (17/36 pages) [=============== ] 50% (18/36 pages) [=============== ] 52% (19/36 pages) [================ ] 55% (20/36 pages) [================= ] 58% (21/36 pages) [================== ] 61% (22/36 pages) [=================== ] 63% (23/36 pages) [==================== ] 66% (24/36 pages) [==================== ] 69% (25/36 pages) [===================== ] 72% (26/36 pages) [====================== ] 75% (27/36 pages) [======================= ] 77% (28/36 pages) [======================== ] 80% (29/36 pages) [========================= ] 83% (30/36 pages) [========================= ] 86% (31/36 pages) [========================== ] 88% (32/36 pages) [=========================== ] 91% (33/36 pages) [============================ ] 94% (34/36 pages) [============================= ] 97% (35/36 pages) [==============================] 100% (36/36 pages) Done in 5.652 seconds

Ok I can understand why is the micro speech not working. There is no microphone on the boards. But what about the blink example?

Sorry again but anyone can help here? Thanks!

Hi What did you expect ? Blink just blink the green led.

Yes :) I expected some led blinking.... But nothing. By the way I also saw that there is a sample code for the NANO 33 BLE called PDMSerialPlotter:

This example reads audio data from the on-board PDM microphones, and prints out the samples to the Serial console. The Serial Plotter built into the Arduino IDE can be used to plot the audio data (Tools -> Serial Plotter)

SO is there a microphone on this board? If it is the case so the micro -speech example detecting "Yes "should work also...

Could you send us your blink code. Works perfectly on mine.

You can see here the digital microphone. But I never used it.

According to the link you sent me you have the NANO 33 BLE SENSE which has a microphone for sure.

I work with NANO 33 BLE - See the link.

SO it seems that my board does not have a mic.

The code for the blinking is the arduino’s one:

/*
This example reads audio data from the on-board PDM microphones, and prints
out the samples to the Serial console. The Serial Plotter built into the
Arduino IDE can be used to plot the audio data (Tools → Serial Plotter)

Circuit:

  • Arduino Nano 33 BLE board

This example code is in the public domain.
*/

#include <PDM.h>

// buffer to read samples into, each sample is 16-bits
short sampleBuffer[256];

// number of samples read
volatile int samplesRead;

void setup() {
Serial.begin(9600);
while (!Serial);

// configure the data receive callback
PDM.onReceive(onPDMdata);

// optionally set the gain, defaults to 20
// PDM.setGain(30);

// initialize PDM with:
// - one channel (mono mode)
// - a 16 kHz sample rate
if (!PDM.begin(1, 16000)) {
Serial.println(“Failed to start PDM!”);
while (1);
}
}

void loop() {
// wait for samples to be read
if (samplesRead) {

// print samples to the serial monitor or plotter
for (int i = 0; i < samplesRead; i++) {
Serial.println(sampleBuffer*);*

  • }*
  • // clear the read count*
  • samplesRead = 0;*
  • }*
    }
    void onPDMdata() {
  • // query the number of bytes available*
  • int bytesAvailable = PDM.available();*
  • // read into the sample buffer*
  • PDM.read(sampleBuffer, bytesAvailable);*
  • // 16-bit, 2 bytes per sample*
  • samplesRead = bytesAvailable / 2;*
    }
    So maybe it is built for the SENSE version of this board.
    Right now I am only looking for a code that fits my board :slight_smile:
    Fabrice

Oops sorry. I sent the audio example instead. Here is the blink sample code:

/* Blink

Turns an LED on for one second, then off for one second, repeatedly.

Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZERO it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN is set to the correct LED pin independent of which board is used. If you want to know what pin the on-board LED is connected to on your Arduino model, check the Technical Specs of your board at: https://www.arduino.cc/en/Main/Products

modified 8 May 2014 by Scott Fitzgerald modified 2 Sep 2016 by Arturo Guadalupi modified 8 Sep 2016 by Colby Newman

This example code is in the public domain.

http://www.arduino.cc/en/Tutorial/Blink */

// the setup function runs once when you press reset or power the board void setup() { // initialize digital pin LED_BUILTIN as an output. pinMode(LED_BUILTIN, OUTPUT); }

// the loop function runs over and over again forever void loop() { digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level) delay(1000); // wait for a second digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW delay(1000); // wait for a second }

Regards

The nano 33 BLE actually has 2 LED's, which could be blinked.

One is referred to as LED_BUILTIN (which should be yellow and this is used in the blink example) and the other is LED_PWR (green).

Try swapping the LED_BUILTIN for LED_PWR to see what happens.

Thank you I will try that but only once I will make my board work again.

I tried to upload another simple sketch and after that I could not to the board anymore.

I tried the double press button method but it does not work on my board.

I believe I need to open a different post for that issue :)

If you have some advise concerning this issue I will be please to get it. Thanks a lot!

Ok I succeeded to solve the problem of the USB connection.

Now I tried your test and it is working fine. The green led is now blinking.

SO why does the other led not work?

I know that this led is working since when I upload the micro_speech sample, this led is emitting a strong white color (like a camera flash).

So what can be the problem?

Hello, I will be pleased if someone from Arduino Support can help here. Can LED_BUILTIN be used with Nano BLE 33 HW? Can the yellow/orange LED be burnt?

Thanks for the support.

Fabrice

Both the Arduino Nano 33 BLE and the Arduino Nano 33 BLE Sense have a RGB LED onboard.

Here is a sketch that will blink all LEDs.

void setup()
{
  pinMode( LED_BUILTIN, OUTPUT );
  pinMode( LED_PWR, OUTPUT );
  pinMode( LEDR, OUTPUT );
  pinMode( LEDG, OUTPUT );
  pinMode( LEDB, OUTPUT );

  // Arduino Nano 33 BLE onboard RGB LED are active low
  digitalWrite( LEDR, HIGH );
  digitalWrite( LEDG, HIGH );
  digitalWrite( LEDB, HIGH );
}

void loop()
{
  long r = random( 7 ) + 2;
  blinkLed( r, 80 );
  r = random( 2 );
  blinkLed( r, 80 );
}

void blinkLed( int led, int d )
{
  switch ( led )
  {
    case 0:
      digitalWrite( LED_BUILTIN, HIGH );
      delay( d );
      digitalWrite( LED_BUILTIN, LOW );
      break;
    case 1:
      digitalWrite( LED_PWR, HIGH );
      delay( d );
      digitalWrite( LED_PWR, LOW );
      break;
    case 2:
      digitalWrite( LEDR, LOW );
      delay( d );
      digitalWrite( LEDR, HIGH );
      break;
    case 3:
      digitalWrite( LEDG, LOW );
      delay( d );
      digitalWrite( LEDG, HIGH );
      break;
    case 4:
      digitalWrite( LEDB, LOW );
      delay( d );
      digitalWrite( LEDB, HIGH );
      break;
    case 5:
      digitalWrite( LEDR, LOW );
      digitalWrite( LEDG, LOW );
      delay( d );
      digitalWrite( LEDR, HIGH );
      digitalWrite( LEDG, HIGH );
      break;
    case 6:
      digitalWrite( LEDR, LOW );
      digitalWrite( LEDB, LOW );
      delay( d );
      digitalWrite( LEDR, HIGH );
      digitalWrite( LEDB, HIGH );
      break;
    case 7:
      digitalWrite( LEDB, LOW );
      digitalWrite( LEDG, LOW );
      delay( d );
      digitalWrite( LEDB, HIGH );
      digitalWrite( LEDG, HIGH );
      break;
    default:
      digitalWrite( LEDR, LOW );
      digitalWrite( LEDG, LOW );
      digitalWrite( LEDB, LOW );
      delay( d );
      digitalWrite( LEDR, HIGH );
      digitalWrite( LEDG, HIGH );
      digitalWrite( LEDB, HIGH );
      break;
  }
}

Please note that the RGB LED has active LOW LEDs (see schematic). So, you need to write LOW to switch them ON.

Klaus, Thank you for your answer. Using the blink code I succeeded to blink the PWR LED. But replacing it with LED_BUILTIN does not blink the Yellow led. I will try your code and update. Thanks Fabrice

Hi Klaus, Thank you for your code. Actually the whole code works fine apart from the LED_BUILTIN.

I even erased all the code and keeping only the following:

digitalWrite( LED_BUILTIN, HIGH ); delay( d ); digitalWrite( LED_BUILTIN, LOW );

Using that,no LED was blinking.

Is it possible that the definition of LED_BUILTIN is now obsolete?

Fabrice

No, LED_BUILTIN should work. Sounds like the LED itself is faulty.

Yes probably. This led is near the USB connector right? like the Power LED but the other side?

bfs013: Yes probably. This led is near the USB connector right? like the Power LED but the other side?

Yes, that is the one. This is not a software but a hardware issue. The LED can be faulty or maybe placed the wrong way around.

Understood. Thanks a lot!

I tried it out, works great! All the LEDs are blinking away like mad! I love it.

Thanks!!