Basic compiler MachiKania type P for PicoCalc

You are welcome!

Here is another example. Thank you, n602_na!

BU-MachiKania-2

5 Likes

Now have good reason to test LSM9DS1
iNEMO inertial module with 3D accelerometer, 3D gyroscope, 3D magnetometer, temperature…

1 Like

Can not find reference for SETPIN in *-e.txt files

Can you please let me know what is *equivalent in MachiKania Basic compiler?

SetPin gp4, gp5, I2C
I2C open 100, 200

*example from MMBASIC

It seems that I2c is not in reach on the PicoCalc side connector….

According to the phyllosoma/PicoCalc at main · machikania/phyllosoma · GitHub

Port assignment

The I/O ports are assigned as follows:

GP0 I/O bit0 / PWM3 / I2C SDA / button1 (UP)
GP1 I/O bit1 / PWM2 / I2C SCL / button2 (LEFT)
GP2 I/O bit2 / PWM1 / button3 (RIGHT)
GP3 I/O bit3 / SPI CS / button4 (DOWN)
GP4 I/O bit4 / UART TX / button5 (START)
GP5 I/O bit5 / UART RX / button6 (FIRE)
GP6 I2C1_SDA (Keyboard)
GP7 I2C1_SCL (Keyboard)
...

EDIT

Please ignore question, have discovered INI file :stuck_out_tongue:

1 Like

If anyone is interested, I wrote a syntax plugin to write MachiKania code in VIM.

6 Likes

MachiKania type P ver 1.6.1 was released:

Please download the “machikania-rt-161.zip” for PicoCalc.

From the readme.txt:

Pyllosoma 1.61/KM-1511 (2025.12.27)

  • Enabled display of statement or function help when using the editor
  • Added the RND#() function
  • Improved TLS handshake for network connections; files larger than 16 Kb can now be retrieved via HTTPS
  • Supported use of PWM4–PWM9, with ports configurable via the INI file
  • Fixed behavior of OUT8L/IN8L, OUT8H/IN8H, and OUT16/IN16 statements in PicoCalc, ResTouch, and type PU mini
  • Fixed a bug where compilation failed in certain environments when one class used another within class files
  • Added FFTLIB class to the class library for performing fast Fourier transform and inverse transform
  • Updated WGET in the class library to handle 301 Moved responses
  • Corrected class.txt
  • Added help-k.txt

The uf2 files were constructed by using pico-sdk ver 2.2.0, so they can be booted from the bootloaders.

5 Likes

MachiKania type P ver 1.6.1 now supports “RND#()” float function, which produces random value between 0 and 1.

2 Likes

Thank you very much, I really appreciate it.

1 Like

Am I the only one that is unable to run the non-graphics samples?

  • In the timer interrupt test, the interrupt never fires
  • Running any of the sound examples produces a click and then silence

Please let us know the detail of symptom.

  1. What program did you use? Is it a program in samples directory?
  2. What pico board do you use (Pico/Pico W/Pico 2/Pico 2 W)?
  3. Did you adjust the volume knob at the left of PicoCalc?

I’m using the Pico 2 W, I double checked that the correct firmware was loaded. I loaded it via uf2loader but I don’t think that should affect things.

The sample program for the timer is TIME-INT.BAS sample program. I tried reducing the timer interval of 1000000 microseconds since KM-BASICs own documentation claims the maximum is 175769 but it didn’t help.

Sound was tested with the SOUND.BAS and MUSIC.BAS sample program. Altering the volume control, or plugging in headphones has no effect. I don’t think the sound hardware is completely defective as short click is heard at startup or when a SOUND statement is used.

Please follow these steps:

  1. Download the newest version of 1.6.1 ( machikania-pc-161.zip ), but not the 1.6.0. The previous version may not work with uf2loader.
  2. Copy “phyllosoma_kb.uf2” in “pico2_w_picocalc” directory in zip archive to “pico2-apps” in your SD card. Rename it to your convenient file name.
  3. Copy MACHIKANIA.INI in zip archive to the root of SD card. Edit it if required.
  4. Copy docs, LIB and samples directories in zip archive to the root of SD card.
  5. Select the uf2 file of 2. to start MachiKania

If you follow above steps and still have the problem, please let me know.

I loaded the new version and can confirm both timer and sound work great. Thanks!

1 Like

MachiKania type P ver 1.7.0 was released:

Please download the “machikania-pc-170.zip” for PicoCalc.

From the readme.txt:

Phyllosoma 1.70/KM-1512 (2026.6.20)

  • Added the STRCMP() function
  • Added string operators (=, !=, <, <=, >, >=, AND, OR)
  • Enabled the use of strings as conditional expressions in IF and similar statements
  • Added support for developing applications with age restrictions
  • Made the LCD orientation obtainable via SYSTEM(30)
  • Added the CLEAR statement

The uf2 files were constructed by using pico-sdk ver 2.2.0, so they can be booted from the bootloaders.

3 Likes

On June 15, 2026, the operational rules governing publicly trusted TLS certificates underwent a significant change. As a result, many HTTPS sites from which data could previously be retrieved using the WGET class (with MachiKania ver 1.7.0) have become inaccessible for data retrieval since that date.

I’m now working on this for supporting TLS 1.3 handshake between MachiKania and HTTPS web servers (GitHub - kmorimatsu/phyllosoma_TLS13 · GitHub). We will probably support the TLS 1.3 in the next official MachiKania version.

Only the Raspberry Pi Pico 2 W will be supported, but Pico W won’t, because TLS 1.3 handshake requires large size of RAM area, and Pico W doesn’t have enough size of RAM.

If your target web site uses one of the following CA root certificate:

ISRG Root X2
GTS Root R1
Security Communication RootCA2
DigiCert Global Root G3
Amazon Root CA 1
USERTrust ECC

you can try the following release as the temporal solution (pico_w_picocalc.zip).

4 Likes

I found a way to solve the problem (where MachiKania ver 1.7 cannot connect to many https sites), which uses TLS 1.2 handshake instead of TLS 1.3 handshake. Most of web sites were still confirmed to support TLS 1.2, so this solution must work for these cases.

The following link is the temporally binaries to connect to https server by using MachiKania production version with Raspberry Pi Pico 2W. This version is better than the version 0.0.6 on several thing except for using TLS 1.2 instead of TLS 1.3.

We will probably support the TLS 1.2 with this way in the next official version of MachiKania.

2 Likes

This is very cool. Feels simpler and more retro than MMBasic, but also seems to be significantly faster, so I’m going to be learning and trying this out this week and test its capability.

1 Like