Program Suggestions / Ideas (Basic)

Good call, I wrote an ePub reader before and the format for the content is HTML, so you first need to write a HTML rendering engine first.

I’m not sure if it even works on modern PCs today.

Anyway, I really believe that we need applications that fit the strengths of the PicoCalc. I will always have my phone with me, and it is my consumption device.

I believe that the PicoCalc is a content creation device in a very niche area with the built-in keyboard.

1 Like

Converting epub to text is a three step process, first it needs to be unzipped, then the HTML needs to be stripped out and third the non ASCII characters need to be stripped out.

The first step is pretty easy obviously. For the second step, there are plenty of python scripts out there for stripping HTML, This is the one I use. I wrote a Linux shell script that call the programs to do the first two steps and then performs the last step of converting everything to plain ASCII text. It is a bit slow and it is not perfect, but it works pretty well.

pandoc should be able to do that conversion in one step, and also handle many other formats

PicoBasic/Applications/PicoPub at main · INSCCOIN/PicoBasic A very simple “e-reader” will be doing updates as time goes, I included a converter.bat to take .txt files and convert them to 30 characters per line. The program reads segments from the loaded .txt file in chunks of 25.

2 Likes

I didnt realize there is a hardware rng on the picos, how do you access it? I was thinking about implementing some PRNGs (mersenne twister?) And it would be interesting to compare to “true random”

It has a hardware rng from c++ & micropython I believe something along the lines of

import machine
random_value = machine.rng()

correct me if im wrong but it should give a random 32bit integer, Picomite also has a random command

Looking at the code it appear the MMBasic RND function produces a true H/W generated random number on the RP2350 and a pseudo random number on the RP2040. In addition, according to the manual, both support the MATH(RAND) function

"Returns a random number 0.0 <= n < 1.0 using the “Mersenne Twister algorithm. If not seeded with MATH RANDOMIZE the first usage seeds with the time in microseconds since boot”

2 Likes

Follow up on PicoPub… Loving this little project, currently working on a better status bar

Version 1.7:

  • Added automatic wrapping of long lines to fit screen width.
  • Status bar now shows: current page, total pages, line range, total lines and the filename.
  • Status bar made more compact and information-dense.
  • Removed Q/J text from status bar for minimalism.
  • Improved code structure and readability (grouped config, globals, and logic).
  • Minor bug fixes and further code cleanup.
4 Likes

A variable width font would be wonderful for PicoPub.

1 Like

I done did it again gents, I finally got my replacement screen & now I can finally properly debug my programs.

Also, I did some updates to the converter.bat for PicoPub & released a new version of it.

Version 1.8

  • Improved memory efficiency and pico-friendliness.
  • Added compact status bar (page, line range, total lines) (battery is a WIP).
  • Added file info popup (I key) with file size, lines, pages, and filename.
  • Added adjustable lines per page (L key cycles 10/15/20/25 lines).
  • Added jump-to-page/line (J key).
  • Added proper error handling for variables and file not found.
  • Removed line numbers from display (optional via converter.bat).
  • Cleaned up the code some more.
4 Likes

simple idea: help.
i always stumble upon the question.. “which order is that, how is it used” micropython repl has a help which shows the synopis.. MMBasic doesn’t … sadly.. maybe it’s a start to write a help on it so you practise programming and noobs get a program that helps them to learn.. without the need of a 300 page pdf file

There is a help command built in, and mentioned in the huge PDF file on page 117. :wink:

Personally I don’t find it very useful though, and I imagine it could be improved. At the very least the help.txt file could be stored on the SD rather than the A: drive, but formatting could be improved as well. I’m not even sure where to get the most recent version of the help.txt file, but it’s probably buried somewhere in TheBackShed posts.

3 Likes

I am so glad you picked up this project. I can now take it off of my list of programs to write. Good work so far.

1 Like

I added color cycling for the text of the book and a screenshot feature in 1.9.
I’m working on adding Hex Color support for text in 2.0. For PicoPub 2.0 I’m trying to work on a custom font to get more than 35 lines on screen at once vs 25 per this suggestion Program Suggestions / Ideas (Basic) - #30 by BlairLeduc.

Here is 1.9

1 Like

Because you asked kindly, I’m now going to work on cyclable fonts & a file browser that only sees .txt files.

Here is the repo, Pub 2.0

What version 2 of PicoPub brings:

  • Used Madcock’s custom Pico 4x6 pixel font and activated it for all viewer program text.
  • Theres now 37 lines instead of 25 per page.
  • Added direct RGB color input for text color (C key) (Replaced presets).
  • Removed lines per page changing on L key (Being reworked alongside having the ability of changing fonts).
  • Further code cleanup and minor bug fixes.
  • Added better word wrapping the lines are wrapped at the last space before 36 characters, or at 36 if no space is found.
2 Likes

I’ve thinking of writing an interpreter for text adventure scripts.

Reimplement linux cli (just for fun coding)

I made a serverless db using Lambda and S3 that might be interesting to look at for a PicoMite db. Dbless under my username on GH

3 Likes

Your dbless looks like a hash table. A hash table would be a nice feature for MMBasic! (I kind of wish it was already built into PicoMite.)

1 Like

Can you point me in the direction of how to create my own fonts?

I’m not aware of any sort of guide on creating fonts, but the useful info I found to be able to figure it out was in the main Picomite download here: https://geoffg.net/Downloads/picomite/PicoMite_Firmware.zip

There’s a “Embedded Fonts” directory in that archive that contains some samples, a PDF describing the fonts, and the FontTweak tool (Windows program). When I edited (or created) fonts, I used FontTweak to load up an existing font, and then toggled pixels on and off with the mouse. FontTweak’s interface doesn’t make that easy, and even running at 1080p it made targeting with the mouse for each pixel a bit of a challenge. I can’t imagine how horrible the experience would be at a higher resolution, and it might even be worth considering running it on a monitor that’s even lower resolution that 1080p. FontTweak can export out the .bas file definition though, which is why I ended up using it. I still hand edited the file it produced to fix the comments, header, and sometimes formatting, but it spits out the data correctly and that was the main thing I wanted.

Someone mentioned on the forums they might be considering building a font editor in MMBasic to run on the PicoCalc and I’m looking forward to that if it happens, because we currently don’t have any good tools to edit fonts. FontTweak is better than nothing, but still frustrating to use, and for folks who don’t have access to a Windows machine and a low enough resolution monitor, it might not even be usable at all. I suspect it would probably work under Wine since it seems to be a relatively simple Win32 application, but I didn’t try.

1 Like

That’s a more accurate description as I found I rarely needed more complex functionality, though I had originally envisioned that

1 Like