# Notes on the Hello World Example for PicoSystem

**URL:** <https://forums.pimoroni.com/t/notes-on-the-hello-world-example-for-picosystem/18021>\
**Category:** Learning Resources\
**Created:** [October 9, 2021, 1:02pm UTC](https://forums.pimoroni.com/t/notes-on-the-hello-world-example-for-picosystem/18021 "2021-10-09T13:02:35Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![dmalec](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/dmalec/32/8211_2.png) [@dmalec](https://forums.pimoroni.com/u/dmalec)\
**Post date:** [October 9, 2021, 1:02pm UTC](https://forums.pimoroni.com/t/notes-on-the-hello-world-example-for-picosystem/18021/1 "2021-10-09T13:02:35Z")

</div>

I recently got a PicoSystem and worked through the tutorial [Getting started with PicoSystem and C++](https://learn.pimoroni.com/article/getting-started-with-picosystem-and-c++). I ran into a couple challenges along the way and thought I’d share how I resolved them in case others also encounter them.

Installed build-essential along with the listed libraries.

When running cmake on the PicoSystem SDK, added the following option (currently issue 4 on the PicoSystem SDK project):

```auto
cmake -DPICOSYSTEM_DIR:PATH=~/picosystem ..

```

Copied pico-sdk/external/pico\_sdk\_import.cmake to the project directory.

Added the following to the example project’s CMakeLists.txt:

```auto
# Pull in PICO SDK (must be before project)
include(pico_sdk_import.cmake)

find_package(PICOSYSTEM REQUIRED)

```

Used the above mentioned options when running cmake on the example project:

```auto
cmake -DPICOSYSTEM_DIR:PATH=~/picosystem ..

```

Added the following to the .cpp file:

```auto
using namespace picosystem;

```

Changed the function signature on the update method to:

```auto
void update(uint32_t tick) {
}

```

The above got me up and running the Hello World example, hope this helps others. Or, if other folks have figured out better approaches, interested in learning them.

-Dan

---

<div class="post-metadata">

**Author:** ![AieCee](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/aiecee/32/8212_2.png) [@AieCee](https://forums.pimoroni.com/u/AieCee)\
**Post date:** [October 10, 2021, 6:28pm UTC](https://forums.pimoroni.com/t/notes-on-the-hello-world-example-for-picosystem/18021/2 "2021-10-10T18:28:52Z")

</div>

I created a bit of a quick and dirty boilerplate to get people going [here](https://github.com/aiecee/picosystem-boilerplate). Probably should only be used in the meantime until someone can come up with a better solution

---

<div class="post-metadata">

**Author:** ![hel](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/hel/32/6075_2.png) [@hel](https://forums.pimoroni.com/u/hel)\
**Post date:** [October 11, 2021, 3:47pm UTC](https://forums.pimoroni.com/t/notes-on-the-hello-world-example-for-picosystem/18021/3 "2021-10-11T15:47:58Z")

</div>

Thanks both, I should hopefully have fixed the tutorial now 🤞

---

<div class="post-metadata">

**Author:** ![dmalec](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/dmalec/32/8211_2.png) [@dmalec](https://forums.pimoroni.com/u/dmalec)\
**Post date:** [October 15, 2021, 10:12pm UTC](https://forums.pimoroni.com/t/notes-on-the-hello-world-example-for-picosystem/18021/4 "2021-10-15T22:12:58Z")

</div>

Following the tutorial using a clean install with the most recent changes to the PicoSystem SDK, I encountered a new issue when running `cmake`:

```auto
CMake Error at /home/vagrant/picosystem/libraries/picosystem.cmake:3 (pico_generate_pio_header):
  Unknown CMake command "pico_generate_pio_header".
Call Stack (most recent call first):
  /home/vagrant/picosystem/picosystem-config.cmake:1 (include)
  CMakeLists.txt:10 (find_package)

-- Configuring incomplete, errors occurred!

```

I was able to work around this by adding a call to `pico_sdk_init()` in the project’s `CMakeLists.txt` like so:

```auto
...
set(CMAKE_CXX_STANDARD 17)

# Initialize the SDK
pico_sdk_init()

find_package(PICOSYSTEM REQUIRED)
...

```

---

<div class="post-metadata">

**Author:** ![bkumanchik](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/bkumanchik/32/8243_2.png) [@bkumanchik](https://forums.pimoroni.com/u/bkumanchik)\
**Post date:** [October 24, 2021, 9:56pm UTC](https://forums.pimoroni.com/t/notes-on-the-hello-world-example-for-picosystem/18021/5 "2021-10-24T21:56:06Z")

</div>

I still can’t get it to work :(

---

<div class="post-metadata">

**Author:** ![dmalec](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/dmalec/32/8211_2.png) [@dmalec](https://forums.pimoroni.com/u/dmalec)\
**Post date:** [October 24, 2021, 10:18pm UTC](https://forums.pimoroni.com/t/notes-on-the-hello-world-example-for-picosystem/18021/6 "2021-10-24T22:18:20Z")

</div>

With recent changes to the SDK, I was getting this error:

```auto
/usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: CMakeFiles/ourproject.dir/home/vagrant/picosystem/libraries/picosystem.cpp.obj: in function `main':
picosystem.cpp:(.text.startup.main+0xd0): undefined reference to `draw(unsigned long)'
collect2: error: ld returned 1 exit status

```

And had to update the signature of the draw method to add a `tick` parameter like so:

```auto
void draw(uint32_t tick) {
  pen(0, 0, 0);
  clear();

  pen(15, 15, 15);
  text("Hello, world!", 0, 0);
}

```

---

<div class="post-metadata">

**Author:** ![bkumanchik](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/bkumanchik/32/8243_2.png) [@bkumanchik](https://forums.pimoroni.com/u/bkumanchik)\
**Post date:** [October 24, 2021, 10:26pm UTC](https://forums.pimoroni.com/t/notes-on-the-hello-world-example-for-picosystem/18021/7 "2021-10-24T22:26:07Z")

</div>

Thanks, I’m trying this now, I’ll let you know if it works!

---

<div class="post-metadata">

**Author:** ![bkumanchik](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/bkumanchik/32/8243_2.png) [@bkumanchik](https://forums.pimoroni.com/u/bkumanchik)\
**Post date:** [October 24, 2021, 10:27pm UTC](https://forums.pimoroni.com/t/notes-on-the-hello-world-example-for-picosystem/18021/8 "2021-10-24T22:27:41Z")

</div>

Woohoo! finally, thanks!

---

<div class="post-metadata">

**Author:** ![dmalec](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/dmalec/32/8211_2.png) [@dmalec](https://forums.pimoroni.com/u/dmalec)\
**Post date:** [October 24, 2021, 10:33pm UTC](https://forums.pimoroni.com/t/notes-on-the-hello-world-example-for-picosystem/18021/9 "2021-10-24T22:33:24Z")

</div>

You’re welcome, glad that helped :)
