ryu10 / M5CardForth

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

M5CardForth (alpha)

[EN|日本語]

M5CardForth

Summary

A simple console for M5Cardputer + ESP32forth.

The current release is alpha.

The following components are roughly combined:

Build / flash the project with Platformio.

Console

At startup, the console reads from the USBSerial input. Open PlatformIO : Serial Console and type on your computer. To use the M5Cardputer keyboard, type m5key-on.

The following words can be used to switch the console I/O : m5key-on m5key-off m5type-on m5type-off

Using M5Cardputer standalone

To use the M5CardForth standalone, without serial, follow the steps:

  1. Do either:
  • Turn M5Cardputer power switch on, or,
  • press and relase the button BtnRst (at the top-left of M5Cardputer).
  1. Immediately after you complete Step 1, press BtnG0 (top-right).
  2. After prompt ok is displayed, you may release BtnG0.

Both the M5Cardputer keyboard and console output will be enabled.

Cardputer keyboard

Supported keys:

  • Alphanumeric and symbols
  • Shift
  • Enter and BS

The ctrl/opt/alt/fn/esc keys do not work.

Sample programs

forth/fastLed.fs

forth/lgfx.fs

forth/M5StampS3-gpio.fs

Additional words

In addition to ESP32Forth standard words, several new words are defined to access the M5cardputer features. Currently under development, the specs will be changed in the future.

-> (See this page)

SD Card support

Use the ESP32Forth SD vocabulary.

SDUsage

Example: block editor

sd
sd.begin
use /sd/myblk
s" /sd/myblk" open-blocks
editor
0 a : hi ." Howdy!" ;
update
save-buffers
0 load hi

Note visual editor does not work with SD.

Using /spiffs/autoexec.fs

You may copy forth/autoexec.fs to /spiffs/autoexec.fs (via an SD card), then the contents of the file will be automatically executed at startup. Type the following to run a demo.

m5demo
go2

Todo

  • switch between Cardputer console and serial ✅
  • rgb led ✅
  • backspace ✅
  • graphics ✅
  • sd card ✅
  • sound
  • mic
  • (ir)
  • (clock)
  • (wifi)

Have fun.

About


Languages

Language:C++ 94.1%Language:Forth 4.7%Language:C 1.2%