I am working on some Adruino code. I am even worse with it than with JavaScript.
What is also hurting me is that I can't as easily test it without uploading the code.
I am needing to practice loops.
I think 2 levels deep.
Would doing it in JS (in a function node) help me?
I know nothing beats doing it with what you need, but where I am: I still can't get my head around the loops.
(Hangs head. I used to be able to do this 30 years ago. But that was in BASIC....)
I recently switched to micropython from arduino/c++ and couldn't be happier. This depends on the hardware you are using. Writing code on the microcontroller and executing directly is fantastic, no more compiling/uploading, not to mention string/array handling horror in c++
This could either be that the section of code isn't being executed or that you haven't set up the serial connection correctly. If you're getting outputs from other parts of the code, then @Colin's suggestion of adding a few more prints is a good idea. It's pretty much the same procedure as debugging JS by adding node.warn calls to track execution.
I've been doing a lot of Arduino/ESP8266/ESP32 development over the last few years, so hopefully can help if you're having problems. C++ isn't really that much different from JS, and you should pick it up quite quickly.
If is C++ though it has some limitations and a few hangovers from C.
You might be better off opening a new project with blink and then playing with some loops and serial prints just to get yourself up to speed. Then review your current code and see where you went wrong.
You might also try the latest beta version of the Arduino IDE which is rather more informative about issues.
I've tried that a few times over the years but kept getting frustrated by the fact that the framework never seems to get updated and is somewhat fragmented and then more frustrated by missing libraries for key hardware.
Of course, I use ESP8266 & ESP32 devices for my microprocessors, I don't use any actual Arduino's eny more. That means that I've swapped almost exclusively to using ESPhome which does all of the boring bits for you without code - just configuration - but still lets you use code where you really need it. It already covers a vast array of common sensors and controls and devices.