Skip to content

Commit d2283e8

Browse files
committed
docs: some small improvments to README
Signed-off-by: deadprogram <[email protected]>
1 parent e36d93d commit d2283e8

File tree

1 file changed

+39
-1
lines changed

1 file changed

+39
-1
lines changed

README.md

+39-1
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,53 @@
22

33
[![Build](https://github.com/tinygo-org/tinyterm/actions/workflows/build.yml/badge.svg?branch=dev)](https://github.com/tinygo-org/tinyterm/actions/workflows/build.yml)
44

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

77
![examples/colors/main.go running on PyPortal](/examples/colors/pyportal_256color.png?raw=true)
88

9+
## How to use it
10+
11+
```go
12+
package main
13+
14+
import (
15+
"fmt"
16+
"time"
17+
18+
"tinygo.org/x/tinyfont/proggy"
19+
"tinygo.org/x/tinyterm"
20+
"tinygo.org/x/tinyterm/displays"
21+
)
22+
23+
var (
24+
font = &proggy.TinySZ8pt7b
25+
)
26+
27+
func main() {
28+
display := displays.Init()
29+
terminal := tinyterm.NewTerminal(display)
30+
31+
terminal.Configure(&tinyterm.Config{
32+
Font: font,
33+
FontHeight: 10,
34+
FontOffset: 6,
35+
UseSoftwareScroll: displays.NeedsSoftwareScroll(),
36+
})
37+
for {
38+
time.Sleep(time.Second)
39+
40+
fmt.Fprintf(terminal, "\ntime: %d", time.Now().UnixNano())
41+
terminal.Display()
42+
}
43+
}
44+
```
45+
946
## How to compile examples
1047

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

1350
- Adafruit Clue (https://www.adafruit.com/clue)
51+
- Badger2040 & Badger2040-W (https://shop.pimoroni.com/products/badger-2040)
1452
- Gopher Badge (https://gopherbadge.com/)
1553
- PyBadge (https://www.adafruit.com/product/4200)
1654
- PyPortal (https://www.adafruit.com/product/4116)

0 commit comments

Comments
 (0)