Arduino nano 33 ble pin doesn't work

Welcome to the forum.

Here are a few things a noted about your code:

  • You should not use delay. It allows to write some very short example code but is generally a bad idea especially for applications with communication stacks. Rewrite your code using millis. Make sure your loop() runs as often as possible. Do not stop and wait for things to happen. Also avoid while as much as possible. Check your buttons, sensors ..., use status variables, set stuff and move on.
  • Custom characteristics and services must use 128-bit random UUIDs. Do not use use 16-bit UUIDs unless they have been specified by the Bluetooth SiG. There are UUID generator available online.
  • I would not use Char for characteristics variable names. That term is used in embedded programming for a specific type.
  • Avoid using your native language. Makes it hard for other to read and understand your code.
  • Listen to kolaha. Test your joystick code with some simple code first.

Here is a BLE example I wrote a long time ago with some tips that may help.

https://forum.arduino.cc/t/bluetooth-communications/902610/2