Skip to content

A minimal terminal for TinyGo display devices. Supporting 256-color ANSI escape codes and also monochrome displays.

License

Notifications You must be signed in to change notification settings

tinygo-org/tinyterm

Repository files navigation

tinyterm - TinyGo Terminal Emulator

Build

A minimal terminal for TinyGo displays. Supporting 256-color ANSI escape codes, as well as monochrome displays such as e-ink or OLED.

examples/colors/main.go running on PyPortal

How to use it

package main

import (
	"fmt"
	"time"

	"tinygo.org/x/tinyfont/proggy"
	"tinygo.org/x/tinyterm"
	"tinygo.org/x/tinyterm/displays"
)

var (
	font = &proggy.TinySZ8pt7b
)

func main() {
	display := displays.Init()
	terminal := tinyterm.NewTerminal(display)

	terminal.Configure(&tinyterm.Config{
		Font:              font,
		FontHeight:        10,
		FontOffset:        6,
		UseSoftwareScroll: displays.NeedsSoftwareScroll(),
	})
	for {
		time.Sleep(time.Second)

		fmt.Fprintf(terminal, "\ntime: %d", time.Now().UnixNano())
		terminal.Display()
	}
}

How to compile examples

Most of the examples will work with any of the following hardware:

basic

Displays basic text.

tinygo flash -target pyportal ./examples/basic

colors

Displays ANSI colors.

tinygo flash -target pyportal ./examples/colors

httpclient

Connects to an http server and displays the results. Runs on PyPortal and WioTerminal only, since it requires a connected WiFi coprocessor.

tinygo flash -target pyportal -ldflags="-X main.ssid=MYSSID -X main.pass=MYPASS" ./examples/httpclient

About

A minimal terminal for TinyGo display devices. Supporting 256-color ANSI escape codes and also monochrome displays.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy