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