Skip to content

Commit 3c7ad6d

Browse files
committed
update README
1 parent 73f068a commit 3c7ad6d

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

.vscode/settings.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"go.toolsEnvVars": {
3+
"GOROOT": "/home/pato/.cache/tinygo/goroot-go1.16-b3b7b83b9cd5e2c74aeaeca91cfb31dbe35d841a79329e38dfc23cea74e92c34-syscall",
4+
"GOFLAGS": "-tags=arduino,atmega328p,atmega,avr5,avr,baremetal,linux,arm,tinygo,gc.conservative,scheduler.none"
5+
}
6+
}

README.md

+37
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,39 @@
11
# tinygo-arduino-examples
22
Compilation of LCD screen, ADC, and output examples.
3+
4+
## It is suggested you run tinygo with Go 1.15 until [#44557](https://github.com/golang/go/issues/44557) is fixed
5+
6+
## Run an example
7+
To run any example navigate to the example directory in command line
8+
9+
```console
10+
cd lcdscreen_adc
11+
```
12+
Then flash the arduino. You must know the port it's on. On windows they typically are of the form `COM1` through `COM4`. On Linux the port may look something like `/dev/ttyACM0` or `/dev/ttyUSB0`.
13+
14+
```console
15+
tinygo flash -target=arduino -port=/dev/ttyUSB0 .
16+
```
17+
18+
If everything goes OK, some progress bars should pop up and the process should end with a thankful message:
19+
20+
```console
21+
avrdude: verifying ...
22+
avrdude: 7036 bytes of flash verified
23+
24+
avrdude done. Thank you.
25+
```
26+
27+
You now have tinygo running on your Arduino!
28+
29+
## To create your own "sketch"
30+
31+
1. Create a directory and create a `.go` file of any name. Say we make `twister.go`.
32+
2. Create the module. Run `go mod init my_awesome_module` (with any module name you find appropiate for your program)
33+
3. Start coding in this directory. You may create more files if you wish to distribute you functions
34+
* To enable intellisense on VSCode follow the [instructions on IDE integration on tinygo.org](https://tinygo.org/ide-integration/). You basically have to create the same [`.vscode/settings.json`](.vscode/settings.json) file this repo has but with you own `GOROOT` Path (this may differ between installations)
35+
4. Run `go mod tidy` when done programming. And flash your sketch with
36+
37+
```console
38+
tinygo flash -target=arduino -port=/dev/ttyUSB0 .
39+
```

0 commit comments

Comments
 (0)