# PicoCalc Text Starter (C/C++)

**URL:** <https://forum.clockworkpi.com/t/picocalc-text-starter-c-c/18451>\
**Category:** PicoCalc\
**Tags:** development, opensource, software, picocalc\
**Created:** [July 7, 2025, 2:58am UTC](https://forum.clockworkpi.com/t/picocalc-text-starter-c-c/18451 "2025-07-07T02:58:16Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![BlairLeduc](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/blairleduc/32/11808_2.png) [@BlairLeduc](https://forum.clockworkpi.com/u/BlairLeduc)\
**Post date:** [July 7, 2025, 2:58am UTC](https://forum.clockworkpi.com/t/picocalc-text-starter-c-c/18451/1 "2025-07-07T02:58:16Z")

</div>

I would like to introduce the PicoCalc Starter Kit for those that want to use develop for the PicoCalc using C/C++ on the bare metal using the Pico-Series C/C++ SDK.

* * *

> **[GitHub - BlairLeduc/picocalc-text-starter: Get started on the PicoCalc using the...](https://github.com/BlairLeduc/picocalc-text-starter/tree/main)**
>
> main

* * *

This is not designed to create graphical games as the display driver does not use a frame buffer and is text-based. It does use very little memory. You can create text-based games, if you wish.

I have drivers for:

- Audio (stereo)
- Display (multicolour text with ANSI escape code emulation)
- Keyboard
- Serial port
- South bridge functions (keyboard, battery, backlights, power)
- FAT32 for reading/writing to the SD card

These are not best-of-breed drivers. Hopefully, this is something to get you going fast and you can then enhance/replace components as you need. The drivers have simple APIs, and they should work independently, allowing you to pick and choose. At the very least, I passing some knowledge along.

The README explains it all.

---

<div class="post-metadata">

**Author:** ![ysirotenko](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/ysirotenko/32/12652_2.png) [@ysirotenko](https://forum.clockworkpi.com/u/ysirotenko)\
**Post date:** [July 7, 2025, 5:03am UTC](https://forum.clockworkpi.com/t/picocalc-text-starter-c-c/18451/2 "2025-07-07T05:03:45Z")

</div>

Thanks for project, it helps develop firmwares more easily.

---

<div class="post-metadata">

**Author:** ![guu](https://avatars.discourse-cdn.com/v4/letter/g/7ab992/32.png) [@guu](https://forum.clockworkpi.com/u/guu)\
**Post date:** [July 7, 2025, 6:16am UTC](https://forum.clockworkpi.com/t/picocalc-text-starter-c-c/18451/3 "2025-07-07T06:16:21Z")

</div>

Very good project

in case if anyone try to run this on pico1 like ,here is the diff

```auto
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c1bbe7b..aac107a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -23,7 +23,7 @@ if (EXISTS ${picoVscode})
     include(${picoVscode})
 endif()
 # ====================================================================================
-set(PICO_BOARD pico2_w CACHE STRING "Board type")
+#set(PICO_BOARD pico2_w CACHE STRING "Board type")
 
 # Pull in Raspberry Pi Pico SDK (must be before project)
 include(pico_sdk_import.cmake)
diff --git a/drivers/onboard_led.c b/drivers/onboard_led.c
index 7d77e0b..faa49db 100644
--- a/drivers/onboard_led.c
+++ b/drivers/onboard_led.c
@@ -6,7 +6,8 @@
 //
 
 #ifndef PICO_DEFAULT_LED_PIN
-#include "pico/cyw43_arch.h"
+//#include "pico/cyw43_arch.h"
+#define PICO_DEFAULT_LED_PIN 25
 #endif
 
 #include "onboard_led.h"

```

---

<div class="post-metadata">

**Author:** ![BlairLeduc](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/blairleduc/32/11808_2.png) [@BlairLeduc](https://forum.clockworkpi.com/u/BlairLeduc)\
**Post date:** [July 7, 2025, 11:04am UTC](https://forum.clockworkpi.com/t/picocalc-text-starter-c-c/18451/4 "2025-07-07T11:04:30Z")

</div>

My bad! Thank you @guu.

I have changed the default board to “pico”, as it should have been from the start, and added a missing include which broke the build for non-wireless Pico’s.

---

<div class="post-metadata">

**Author:** ![BlairLeduc](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/blairleduc/32/11808_2.png) [@BlairLeduc](https://forum.clockworkpi.com/u/BlairLeduc)\
**Post date:** [July 9, 2025, 1:17am UTC](https://forum.clockworkpi.com/t/picocalc-text-starter-c-c/18451/5 "2025-07-09T01:17:22Z")

</div>

I have implemented read functionality (the easy part) for FAT32-formatted SD cards. In this update:

- Open and read from files and directories
- Long filenames are supported
- Absolute and relative paths
- Change and retrieve your current directory
- Supports both SDSC (standard capacity) and SDHC (high capacity) cards
- Can read the MBR-partitioned disk layout (not GPT) and the unpartitioned disk layout
- Documentation updated to include new functionality

I have started to create compiled “releases” with a selection of uf2 files for the Pico boards to demonstrate the starter.

> **[Release v0.2 · BlairLeduc/picocalc-text-starter](https://github.com/BlairLeduc/picocalc-text-starter/releases/tag/v0.2)**
>
> Add ability to read FAT32 volumes on an SD card. Two drivers are added:
> 
> sdcard – low-level driver that configures the Pico to access the SD card
> fat32 – read from a FAT32 volume
> 
> This release prov...

---

<div class="post-metadata">

**Author:** ![Astrox](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/astrox/32/13039_2.png) [@Astrox](https://forum.clockworkpi.com/u/Astrox)\
**Post date:** [July 11, 2025, 2:26am UTC](https://forum.clockworkpi.com/t/picocalc-text-starter-c-c/18451/6 "2025-07-11T02:26:52Z")

</div>

@BlairLeduc I was wondering, so In my OS kernel, I would like to initialize the display and keyboard, but nothing else, as everything else will be initialized when needed, and I was wondering how I could do that.

---

<div class="post-metadata">

**Author:** ![beapig](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/beapig/32/11901_2.png) [@beapig](https://forum.clockworkpi.com/u/beapig)\
**Post date:** [July 11, 2025, 7:06am UTC](https://forum.clockworkpi.com/t/picocalc-text-starter-c-c/18451/7 "2025-07-11T07:06:46Z")

</div>

there is full implementation of an “OS” example on the officical Fuzix repo（[https://github.com/clockworkpi/PicoCalc/tree/master/Code/FUZIX）](https://github.com/clockworkpi/PicoCalc/tree/master/Code/FUZIX%EF%BC%89)

why not just try to study it first？

what you ask is huge question rather than something can answer via “community reply”

---

<div class="post-metadata">

**Author:** ![BlairLeduc](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/blairleduc/32/11808_2.png) [@BlairLeduc](https://forum.clockworkpi.com/u/BlairLeduc)\
**Post date:** [July 11, 2025, 10:47am UTC](https://forum.clockworkpi.com/t/picocalc-text-starter-c-c/18451/8 "2025-07-11T10:47:47Z")

</div>

Looks like you figured it out?

---

<div class="post-metadata">

**Author:** ![Astrox](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/astrox/32/13039_2.png) [@Astrox](https://forum.clockworkpi.com/u/Astrox)\
**Post date:** [July 12, 2025, 12:59am UTC](https://forum.clockworkpi.com/t/picocalc-text-starter-c-c/18451/9 "2025-07-12T00:59:56Z")

</div>

Yeah, I did, it was simpler than I thought.

---

<div class="post-metadata">

**Author:** ![BlairLeduc](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/blairleduc/32/11808_2.png) [@BlairLeduc](https://forum.clockworkpi.com/u/BlairLeduc)\
**Post date:** [July 13, 2025, 6:46pm UTC](https://forum.clockworkpi.com/t/picocalc-text-starter-c-c/18451/10 "2025-07-13T18:46:17Z")

</div>

I released v0.3 today:

Adds the ability to write to an SD card formatted with the FAT32 file system.

- Write to a file
- Remove a file or directory

This update always uses long filenames for files and directories to maintain case and special characters.

The auto-mount/unmount is more reliable now.

Adds additional tests for FAT32 and the keyboard.

The compiled UF2 files for this release:

> **[Release v0.3 · BlairLeduc/picocalc-text-starter](https://github.com/BlairLeduc/picocalc-text-starter/releases/tag/v0.3)**
>
> Adds the ability to write to an SD card formatted with the FAT32 file system.
> 
> Write to a file
> Remove a file or directory
> 
> This update always uses long filenames for files and directories to mainta...

---

<div class="post-metadata">

**Author:** ![BlairLeduc](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/blairleduc/32/11808_2.png) [@BlairLeduc](https://forum.clockworkpi.com/u/BlairLeduc)\
**Post date:** [July 13, 2025, 6:50pm UTC](https://forum.clockworkpi.com/t/picocalc-text-starter-c-c/18451/11 "2025-07-13T18:50:08Z")

</div>

**The PicoCalc-text-starter feature set is complete now.**

I am still maintaining it for enhancements and bug reports/fixes.

I am moving on to my next PicoCalc project!

> **[GitHub - BlairLeduc/picocalc-text-starter: Get started on the PicoCalc using the Pico-Series...](https://github.com/BlairLeduc/picocalc-text-starter)**
>
> Get started on the PicoCalc using the Pico-Series C/C++ SDK.

---

<div class="post-metadata">

**Author:** ![tabemann](https://avatars.discourse-cdn.com/v4/letter/t/df705f/32.png) [@tabemann](https://forum.clockworkpi.com/u/tabemann)\
**Post date:** [July 14, 2025, 4:16am UTC](https://forum.clockworkpi.com/t/picocalc-text-starter-c-c/18451/12 "2025-07-14T04:16:40Z")

</div>

How do you implement _renaming_ files with long file names? I have been hesitant to implement LFN’s in zeptoforth because it would make renaming files far too complex because LFN’s of course live as arbitrary numbers of contiguous dummy directory entries.

---

<div class="post-metadata">

**Author:** ![BlairLeduc](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/blairleduc/32/11808_2.png) [@BlairLeduc](https://forum.clockworkpi.com/u/BlairLeduc)\
**Post date:** [July 14, 2025, 11:16am UTC](https://forum.clockworkpi.com/t/picocalc-text-starter-c-c/18451/13 "2025-07-14T11:16:51Z")

</div>

As I just went through this myself, your hesitation is well founded!

Also, this being a starter library vs a language people depend upon gives me a pass on a lot of things.

With that, I left renaming files as out-of-scope for this library, mainly because I forgot about it.

However, if I were to add that feature, I would implement it as a move instead and free the directory entry, that would include the LFN’s, and create new entry with the new name in the possibility changed directory.

To be safe in a multithreaded system, you might do that the other way around. Also, depending how you do the equivalent of FILE \*, it will be safe, since you are not moving the cluster layout, any open files will not be impacted.

One cautionary note, LFN entries can cross sector and cluster boundaries adding to the fun.

---

<div class="post-metadata">

**Author:** ![BlairLeduc](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/blairleduc/32/11808_2.png) [@BlairLeduc](https://forum.clockworkpi.com/u/BlairLeduc)\
**Post date:** [July 17, 2025, 9:45pm UTC](https://forum.clockworkpi.com/t/picocalc-text-starter-c-c/18451/14 "2025-07-17T21:45:27Z")

</div>

Small release today, v0.4:

- Add underscore and bold text
- Connected the standard C library file operations (fopen, fread, etc) to the fat32 driver

> **[Release v0.4 · BlairLeduc/picocalc-text-starter](https://github.com/BlairLeduc/picocalc-text-starter/releases/tag/v0.4)**
>
> What's Changed
> 
> Add integration for standard C library file functions
> Add support for underscoring text
> Add support for bold text
> 
> Full Changelog: v0.3...v0.4

---

<div class="post-metadata">

**Author:** ![BlairLeduc](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/blairleduc/32/11808_2.png) [@BlairLeduc](https://forum.clockworkpi.com/u/BlairLeduc)\
**Post date:** [July 19, 2025, 1:46am UTC](https://forum.clockworkpi.com/t/picocalc-text-starter-c-c/18451/15 "2025-07-19T01:46:52Z")

</div>

Another release today, v0.5:

- Corrected a problem preventing the Pico 1 from initialising SD cards
- Recognise key on pressed state, key repeat
- Update enhances file handling
  - Now correct reports errors with errno for file operations

> **[Release v0.5 · BlairLeduc/picocalc-text-starter](https://github.com/BlairLeduc/picocalc-text-starter/releases/tag/v0.5)**
>
> What's Changed
> 
> Replace delays with extra clock cycles
> Recognise key on pressed state
> Update project configuration and enhance file handling
> 
> Full Changelog: v0.4...v0.5

---

<div class="post-metadata">

**Author:** ![M57](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/m57/32/12528_2.png) [@M57](https://forum.clockworkpi.com/u/M57)\
**Post date:** [July 19, 2025, 2:47am UTC](https://forum.clockworkpi.com/t/picocalc-text-starter-c-c/18451/16 "2025-07-19T02:47:39Z")

</div>

This is beautiful (I wish I understood how to make stuff like this)

---

<div class="post-metadata">

**Author:** ![BlairLeduc](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/blairleduc/32/11808_2.png) [@BlairLeduc](https://forum.clockworkpi.com/u/BlairLeduc)\
**Post date:** [July 19, 2025, 3:42am UTC](https://forum.clockworkpi.com/t/picocalc-text-starter-c-c/18451/17 "2025-07-19T03:42:38Z")

</div>

The difference between the possible and the impossible is merely a measure of one’s determination.  
— Captain James Thain

---

<div class="post-metadata">

**Author:** ![M57](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/m57/32/12528_2.png) [@M57](https://forum.clockworkpi.com/u/M57)\
**Post date:** [July 19, 2025, 4:01am UTC](https://forum.clockworkpi.com/t/picocalc-text-starter-c-c/18451/18 "2025-07-19T04:01:06Z")

</div>

Well, my determination is more hardware side vs software. I’m currently knee deep in designing a PCB for my GPIO expander board something that not a whole lot of people know how to do.

---

<div class="post-metadata">

**Author:** ![BlairLeduc](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/blairleduc/32/11808_2.png) [@BlairLeduc](https://forum.clockworkpi.com/u/BlairLeduc)\
**Post date:** [July 19, 2025, 10:52am UTC](https://forum.clockworkpi.com/t/picocalc-text-starter-c-c/18451/19 "2025-07-19T10:52:53Z")

</div>

And I am very much looking forward to seeing more about what you are working towards.

---

<div class="post-metadata">

**Author:** ![BlairLeduc](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/blairleduc/32/11808_2.png) [@BlairLeduc](https://forum.clockworkpi.com/u/BlairLeduc)\
**Post date:** [July 20, 2025, 2:25am UTC](https://forum.clockworkpi.com/t/picocalc-text-starter-c-c/18451/20 "2025-07-20T02:25:22Z")

</div>

I squeezed in another release today, v0.6:

- Added ability to move/rename files
- Now updating the FSInfo structure that caches free space and where to start looking for free clusters
- Renamed FAT32 API functions for consistency by removing redundant file\_ and dir\_ prefixes
- Added stat, link, unlink and rename support to the standard C library, corrected fstat
- Various stabilisation and bug fixes

> **[Release v0.6 · BlairLeduc/picocalc-text-starter](https://github.com/BlairLeduc/picocalc-text-starter/releases/tag/v0.6)**
>
> Added ability to move/rename files
> Now updating the FSInfo structure that caches free space and where to start looking for free clusters
> Renamed FAT32 API functions for consistency by removing redu...

[Next page](https://forum.clockworkpi.com/t/picocalc-text-starter-c-c/18451.md?page=2)
