File tree 1 file changed +39
-1
lines changed
1 file changed +39
-1
lines changed Original file line number Diff line number Diff line change 2
2
3
3
[ ![ 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 )
4
4
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 .
6
6
7
7
![ examples/colors/main.go running on PyPortal] ( /examples/colors/pyportal_256color.png?raw=true )
8
8
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, " \n time: %d " , time.Now ().UnixNano ())
41
+ terminal.Display ()
42
+ }
43
+ }
44
+ ```
45
+
9
46
## How to compile examples
10
47
11
48
Most of the examples will work with any of the following hardware:
12
49
13
50
- Adafruit Clue (https://www.adafruit.com/clue )
51
+ - Badger2040 & Badger2040-W (https://shop.pimoroni.com/products/badger-2040 )
14
52
- Gopher Badge (https://gopherbadge.com/ )
15
53
- PyBadge (https://www.adafruit.com/product/4200 )
16
54
- PyPortal (https://www.adafruit.com/product/4116 )
You can’t perform that action at this time.
0 commit comments