Code doesn't work for new Arduino Nano 33 BLE board

Hi, I am pretty new to Arduino.
I have code that worked successfully with my old Arduino board about a year ago. Then this year I bought two new ones, but I couldn't successfully run through all the lines in my code. (I can successfully upload my code to Arduino board)

Does anyone know the potential problem with it?
Is it possible that the same code that works for the old Arduino Nana 33 BLE, but not working for the new ones?

@cccroissant, your topic has been moved to a more suitable location on the forum.

I have no experience with the Nano33 BLE but it sounds highly unlikely. One possible reason might be that you use a different version of the compiler (e.g. board package upgrade, new install) which might result in different executables.

If you upload your code to the original board from the same PC, does it still work on the original board?

@cccroissant Did you install the libraries for your code via the IDE's library manager and ensured that you used the correct corresponding "Analog and Digital" pins in the new board?

Thank you for your help. I think the problem is with the board package.
I downloaded back to the old version and it can work. I think my next step will be trying to update my code so my code can work on the newest version of board package.

Yes, I think so.

Ensure that you install the board's package core, see www.arduino.cc/en/Guide/Cores

Hi @cccroissant. Please provide a detailed description of what you mean by "I couldn't successfully run through all the lines in my code".

Please post your full sketch.

  1. Auto Format your code by following these instructions:
    • If using the Arduino IDE: select Tools > Auto Format from the menus.
    • If using Arduino Cloud Editor: press Ctrl+B
  2. Click on the window that contains your sketch code.
  3. Press Ctrl+A. This will select all the text.
  4. Press Ctrl+C. This will copy the selected text to the clipboard.
  5. In a forum reply here, click on the reply field.
  6. Click the </> icon on the post composer toolbar. This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
    Code block
  7. Press Ctrl+V. This will paste the compilation output into the code block.
  8. Move the cursor outside of the code block markup before you add any additional text to your reply.
  9. Repeat the above process if your sketch has multiple tabs.
  10. Click the Reply button to post the output.

When your code requires a library that's not included with the Arduino IDE please post a link (using the chain links icon on the forum toolbar to make it clickable) to where you downloaded that library from or if you installed it using Library Manager (Sketch > Include Library > Manage Libraries in the Arduino IDE or Libraries > Library Manager in the Arduino Web Editor) then say so and state the full name of the library.

Welcome to the forum.

There were changes with the board support when Arduino separated the mbedOS devices e.g. Nano 33 BLE, Portenta and the new Nano RP2040 Connect. The changes where intentional and can break some code that was written with version 1.x.x (now marked deprecated in the boards manager).

Hi Klaus_K
That answers my questions. My code do works for 1.x.x version.
Thank you