First steps - in a state of confusion :P #2601
-
I am running a Mac (13.7.1). I have installed both versions of the Arduino IDE: Version 2.3.3 and 1.8.19. I have tried to follow the online documentation here. I have managed to upload the 'Blink' example to my Pico-2040, and it actually works! Giddy with success, I tried an example posted by @maxgerhardt. This is not working - here's the output from the IDE "console":
And so it seems I have failed to download something - but I don't know what. I installed via the Arduino Boards Manager, i.e. copied the URL & pasted it into the dialog. What have I missed? |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 12 replies
-
Err, looks like you're running the |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
On Windows 7 (yes, I know), I'm getting matches for stdio.h in C:\Users\andy\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\4.2.0\pico-sdk\src\host\pico_stdio\include\pico and C:\Users\andy\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\4.2.0\pico-sdk\src\rp2_common\pico_stdio\include\pico |
Beta Was this translation helpful? Give feedback.
-
If you choose Preferences on the File menu (assuming it's in the same place on 2.x), you should see a link to preferences.txt, near the bottom. If you click that it should open the folder which is equivalent to my which is the first part of those paths. From there, open packages, then rp2040 etc. It's quite possible you don't need to specifically include stdio.h; I'm not sure. You could try commenting out that line (put // at the beginning). I'm in the habit of removing the # too, which was maybe needed once due to a pre-processor bug but probably isn't anymore. |
Beta Was this translation helpful? Give feedback.
-
"The Answer" was a bit convoluted in the end. It finally came together when I read this comment from @Andy2No ... thanks, Andy! In addition to my mistaken assumption re using examples from the RPi GitHub repo, I had made a few other errors that have been pointed out in this (now) rather long Discussion. Thanks to all for your indulgence. I'll now concentrate on getting @maxgerhardt 's example working. It compiles, but seems to get lost afterwards... but that's for another discussion :) |
Beta Was this translation helpful? Give feedback.
-
You can't copy-paste the pico_sleep example code because
This is the PlatformIO project I used: https://github.com/maxgerhardt/pio-picosleep It should work the same in the Arduino IDE if you open the |
Beta Was this translation helpful? Give feedback.
-
@seamusdemora Here's a video showing how to set up PlatformIO: The first step is installing Microsoft VSCode, or possibly Codium (aka VSCodium) would work instead. Edit: It seems VSCodium is not an option, due to licensing constraints: |
Beta Was this translation helpful? Give feedback.
Okay, it looks like this is more complicated than simply copying the code from there. There's an existing closed issue about it:
#345
The other approach is to learn how to use the SDK, which normally involves VSCode and CMake and/or Platform IO. Personally, I've never done that because I prefer to stick to the Arduino IDE. I do have a version of VSCode installed (called Codium) but I haven't used it much yet, other than for some Raspberry Pi bare metal examples. It doesn't strike me as something I'd want to use more than I had to.