# 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:** 5

<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:** [December 18, 2025, 2:35pm UTC](https://forum.clockworkpi.com/t/picocalc-text-starter-c-c/18451/82 "2025-12-18T14:35:30Z")

</div>

We have such a wonderful community here!

I forgot to hit reply, ☹ so following response is outdated, but may help in the future:

If you add clib.c to your project, you can use the stdio functions `fopen`, `fread`, `fclose`, etc with the `FILE` structure. You may find that easier. I _believe_ that these functions should auto-mount the SD Card as well.

---

<div class="post-metadata">

**Author:** ![TheFlynn49](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/theflynn49/32/14674_2.png) [@TheFlynn49](https://forum.clockworkpi.com/u/TheFlynn49)\
**Post date:** [December 18, 2025, 3:19pm UTC](https://forum.clockworkpi.com/t/picocalc-text-starter-c-c/18451/83 "2025-12-18T15:19:50Z")

</div>

Still, I am confused.

I looked at the source of fat32\_init() and fat32\_mount(), and I couldn’t find any reason for these to make fat32\_open() fail.

I put them back (with some tricky debug see below), and … it works now. And I confirm that your original code was failing.

@BlairLeduc I found what the problem is. In drivers/fat32.c, the function fat32\_mount() doesn’t update the internal flag “mount\_status”. Everywhere Blair calls fat32\_mount(), he updates that flag by calling “mount\_status = fat32\_mount() “

The problem is that Ariel cannot do that. When he calls fat32\_mount(), the internal state of “mount\_status” stays un-mounted. When I call fat32\_is\_ready() for debugging, that fixes the status and it works.

So, IMO, the function fat32\_mount() in fat32.c should be renamed everywhere fat32\_mount\_internal(), and a new function fat32\_mount() (the one for users) should be :

```auto
fat32_error_t fat32_mount(void) {
 return mount_status = fat32_mount_internal();
}

```

Because inside the current fat32\_mount() there are a zillion return statements, and upgrading the flag at every return would be a mess.

my 2¢

---

<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:** [December 18, 2025, 6:00pm UTC](https://forum.clockworkpi.com/t/picocalc-text-starter-c-c/18451/84 "2025-12-18T18:00:18Z")

</div>

I always self-assess with looking at something I wrote six months ago and if I think it looks good, watch out, I have stopped learning!

Looking through the code I should have made fast32\_mount() static and not in the public fat32 API. One should just use the fat32 API and the SD card will be mounted automatically or use fat32\_is\_ready() and if that returns false, use fat32\_get\_status() to see what is wrong.

However, you are absolutely correct! In the current implementation, that is a bug!

---

<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:** [December 18, 2025, 6:03pm UTC](https://forum.clockworkpi.com/t/picocalc-text-starter-c-c/18451/85 "2025-12-18T18:03:01Z")

</div>

I am very much looking forward to trying your project!

---

<div class="post-metadata">

**Author:** ![TheFlynn49](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/theflynn49/32/14674_2.png) [@TheFlynn49](https://forum.clockworkpi.com/u/TheFlynn49)\
**Post date:** [December 18, 2025, 6:17pm UTC](https://forum.clockworkpi.com/t/picocalc-text-starter-c-c/18451/86 "2025-12-18T18:17:26Z")

</div>

Yes, of course, the user should never call fat32\_mount() , silly me 😃

That way its even safer as far as interfacing api is concerned.

thank you for your expertise here !

---

<div class="post-metadata">

**Author:** ![ArielPalazzesi](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/arielpalazzesi/32/16836_2.png) [@ArielPalazzesi](https://forum.clockworkpi.com/u/ArielPalazzesi)\
**Post date:** [December 19, 2025, 7:18pm UTC](https://forum.clockworkpi.com/t/picocalc-text-starter-c-c/18451/87 "2025-12-19T19:18:04Z")

</div>

> [@BlairLeduc](#):
>
> I am very much looking forward to trying your project!

😉

> [@CHIP-8 Emulator (Beta Version)](https://forum.clockworkpi.com/t/chip-8-emulator-beta-version/20819):
>
> Good morning! I’m learning to use C again, with the idea of writing one or more emulators for simple platforms. I started with this one, and in just a few days I’ve achieved a “decent” version that I’d like to share. We’re nearing the end of the year, which makes it a difficult time to move projects forward. At least in my country, there are many social gatherings and end-of-year celebrations. And in January I’ll be traveling. Still, I wanted to start this thread and share the progress so far,…

---

<div class="post-metadata">

**Author:** ![Keith\_Dobbelaere](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/keith_dobbelaere/32/16000_2.png) [@Keith\_Dobbelaere](https://forum.clockworkpi.com/u/Keith_Dobbelaere)\
**Post date:** [March 10, 2026, 3:53am UTC](https://forum.clockworkpi.com/t/picocalc-text-starter-c-c/18451/88 "2026-03-10T03:53:27Z")

</div>

Thanks for the project, Blair. I borrowed from it for mine—I’ve just pushed a bunch of new features, so check it out!  
[KeithDobbelaere/GeometryVibes3D-PicoCalc](https://github.com/KeithDobbelaere/GeometryVibes3D-PicoCalc)

---

<div class="post-metadata">

**Author:** ![jblanked](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/jblanked/32/17438_2.png) [@jblanked](https://forum.clockworkpi.com/u/jblanked)\
**Post date:** [March 26, 2026, 8:18pm UTC](https://forum.clockworkpi.com/t/picocalc-text-starter-c-c/18451/89 "2026-03-26T20:18:57Z")

</div>

Hey, I added a pull request for the audio driver. I noticed you had the `AUDIO_XXX_PIN` defined but they weren’t used.

> <https://github.com/BlairLeduc/picocalc-text-starter/pull/29>
>
> I was working on migrating the audio driver into Picoware and noticed the pins.

---

<div class="post-metadata">

**Author:** ![jblanked](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/jblanked/32/17438_2.png) [@jblanked](https://forum.clockworkpi.com/u/jblanked)\
**Post date:** [April 4, 2026, 12:44pm UTC](https://forum.clockworkpi.com/t/picocalc-text-starter-c-c/18451/90 "2026-04-04T12:44:57Z")

</div>

In the same pull request, I added a commit that changes the `audio_pwm_is_not_silence` range from `100 -> 2000` to `20 -> 20000`, which is the full audible range.

I noticed there’s another pull request for an SD card mount fix. I’m curious to know your stance on pull requests (do you accept any, are you planning to accept any, etc).

Thanks again for your contribution to the community. This project is really the back-bone of most PicoCalc projects.

---

<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:** [April 4, 2026, 8:59pm UTC](https://forum.clockworkpi.com/t/picocalc-text-starter-c-c/18451/91 "2026-04-04T20:59:49Z")

</div>

Yes, pull requests are great! Real life has interrupted fun life.

---

<div class="post-metadata">

**Author:** ![Radamat](https://avatars.discourse-cdn.com/v4/letter/r/59ef9b/32.png) [@Radamat](https://forum.clockworkpi.com/u/Radamat)\
**Post date:** [April 8, 2026, 4:32am UTC](https://forum.clockworkpi.com/t/picocalc-text-starter-c-c/18451/92 "2026-04-08T04:32:57Z")

</div>

Thanks! I used your code to add serial driver to picocalc\_lua. Now it can send and receive files via usb uart.

---

<div class="post-metadata">

**Author:** ![maple](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/maple/32/12677_2.png) [@maple](https://forum.clockworkpi.com/u/maple)\
**Post date:** [April 8, 2026, 8:53pm UTC](https://forum.clockworkpi.com/t/picocalc-text-starter-c-c/18451/93 "2026-04-08T20:53:09Z")

</div>

feel free to make a PR, that would be a welcome addition 🙂 i still lurk the forum and i promise i’ll still come back to it some day!

---

<div class="post-metadata">

**Author:** ![dzubin](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/dzubin/32/17992_2.png) [@dzubin](https://forum.clockworkpi.com/u/dzubin)\
**Post date:** [April 28, 2026, 7:19pm UTC](https://forum.clockworkpi.com/t/picocalc-text-starter-c-c/18451/94 "2026-04-28T19:19:49Z")

</div>

This is a GREAT template for C/C++ programming on the PicoCalc. I’m an old programmer, who grew up using C on PDP-11 UNIX, so I’ve had to re-learn a lot (including “git” and “cmake”), but your code is easy to read, not obfuscated and easy to expand on. Thanks for this!

Thomas Dzubin

Canada

---

<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:** [April 28, 2026, 10:11pm UTC](https://forum.clockworkpi.com/t/picocalc-text-starter-c-c/18451/95 "2026-04-28T22:11:25Z")

</div>

You’re very welcome, from a fellow Canadian!

---

<div class="post-metadata">

**Author:** ![dzubin](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/dzubin/32/17992_2.png) [@dzubin](https://forum.clockworkpi.com/u/dzubin)\
**Post date:** [September 2, 2026, 11:55pm UTC](https://forum.clockworkpi.com/t/picocalc-text-starter-c-c/18451/96 "2026-09-02T23:55:14Z")

</div>

FYI: I just used your code in a new project that I released. Check the topics on the ClockworkPi forum for my PicoCalc Music Maker.

If I’ve used your code in the wrong way, please tell me. Thanks for the great code examples!

---

<div class="post-metadata">

**Author:** ![dzubin](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/dzubin/32/17992_2.png) [@dzubin](https://forum.clockworkpi.com/u/dzubin)\
**Post date:** [September 28, 2026, 10:37pm UTC](https://forum.clockworkpi.com/t/picocalc-text-starter-c-c/18451/97 "2026-09-28T22:37:04Z")

</div>

Blair:

I’m writing a screenshot function for all of the various programs that I’ve written so I don’t have to use my phone camera to take a picture of the screen and I believe that I’ve found a bug in the drivers/fat32.c code. Do you accept patches? Or should I just email you what I’ve found.

Thomas Dzubin

---

<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:** [September 29, 2026, 1:53am UTC](https://forum.clockworkpi.com/t/picocalc-text-starter-c-c/18451/98 "2026-09-29T01:53:29Z")

</div>

Yes I do. Please feel free to create a PR

---

<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:** [October 18, 2026, 2:37pm UTC](https://forum.clockworkpi.com/t/picocalc-text-starter-c-c/18451/99 "2026-10-18T14:37:03Z")

</div>

# Release v0.15

My apologies to everyone who submitted PRs. I have finally merged them to create v0.15. I also updated the starter to use Pico SDK 2.3.1.

## What’s Changed

- Fix seek operation to use updated file position by [@theflynn49](https://github.com/theflynn49) in [#25](https://github.com/BlairLeduc/picocalc-text-starter/pull/25)
- Keyboard update by [@rugosi](https://github.com/rugosi) in [#26](https://github.com/BlairLeduc/picocalc-text-starter/pull/26)
- Update mount\_status correctly before returning from fat32\_mount() by [@KeithDobbelaere](https://github.com/KeithDobbelaere) in [#27](https://github.com/BlairLeduc/picocalc-text-starter/pull/27)
- Replace hardcoded pin numbers with constants by [@jblanked](https://github.com/jblanked) in [#29](https://github.com/BlairLeduc/picocalc-text-starter/pull/29)
- Fix fat32: advance next\_free hint after cluster allocation by [@Dzubin](https://github.com/Dzubin) in [#30](https://github.com/BlairLeduc/picocalc-text-starter/pull/30)
- Add lcd\_unblit(): read pixel data back from the display by [@Dzubin](https://github.com/Dzubin) in [#31](https://github.com/BlairLeduc/picocalc-text-starter/pull/31)
- fat32: skip deleted entries before reading long-name parts (out-of-bounds write) by [@Dzubin](https://github.com/Dzubin) in [#32](https://github.com/BlairLeduc/picocalc-text-starter/pull/32)
- sdcard: wait for a busy card by time, and before every command by [@Dzubin](https://github.com/Dzubin) in [#33](https://github.com/BlairLeduc/picocalc-text-starter/pull/33)
- Upgrade to SDK 2.3.1 by [@BlairLeduc](https://github.com/BlairLeduc) in [#34](https://github.com/BlairLeduc/picocalc-text-starter/pull/34)

* * *

> **[Release v0.15 · BlairLeduc/picocalc-text-starter](https://github.com/BlairLeduc/picocalc-text-starter/releases/tag/v0.15)**
>
> What's Changed
> 
> Fix seek operation to use updated file position by @theflynn49 in #25
> Keyboard update by @rugosi in #26
> Update mount\_status correctly before returning from fat32\_mount() by @KeithDo...

---

<div class="post-metadata">

**Author:** ![Codiator](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/codiator/32/15080_2.png) [@Codiator](https://forum.clockworkpi.com/u/Codiator)\
**Post date:** [October 18, 2026, 3:32pm UTC](https://forum.clockworkpi.com/t/picocalc-text-starter-c-c/18451/100 "2026-10-18T15:32:42Z")

</div>

Have you had a chance to add my 'Show-MAC-Address" extension for W-picos, too?

---

<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:** [October 18, 2026, 4:54pm UTC](https://forum.clockworkpi.com/t/picocalc-text-starter-c-c/18451/101 "2026-10-18T16:54:34Z")

</div>

No, I eventually decided that feature would not fit with the purpose of the PicoCalc Text Starter. This project is a starter for the PicoCalc, not an introduction for the Pico W or Pico 2 W.

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

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