Slide 1

Slide 1 text

TinyGo tinygo.org Ladislav Prskavec - Golang Prague #4, 4th Sep 2019 1

Slide 2

Slide 2 text

TinyGo A go compiler for small places Ladislav Prskavec - Golang Prague #4, 4th Sep 2019 2

Slide 3

Slide 3 text

Hello World Ladislav Prskavec - Golang Prague #4, 4th Sep 2019 3

Slide 4

Slide 4 text

Microcontrollers Ladislav Prskavec - Golang Prague #4, 4th Sep 2019 4

Slide 5

Slide 5 text

Micro:bit microbit.org Ladislav Prskavec - Golang Prague #4, 4th Sep 2019 5

Slide 6

Slide 6 text

Micro:bit 4 Nordic nRF51822 – 16 MHz 32-bit ARM Cortex-M0 microcontroller, 256 KB flash memory, 16 KB static ram, 2.4 GHz Bluetooth low energy wireless networking. 4 NXP/Freescale KL26Z – 48 MHz ARM Cortex-M0+ core microcontroller, that includes a full- speed USB 2.0 On-The-Go (OTG) controller, used as a communication interface between USB and main Nordic microcontroller. 4 NXP/Freescale MMA8652 – 3-axis accelerometer sensor via I²C-bus. 4 NXP/Freescale MAG3110 – 3-axis magnetometer sensor via I²C-bus (to act as a compass and metal detector). 4 MicroUSB connector, battery connector, 25-pin edge connector. 4 Display consisting of 25 LEDs in a 5×5 array.[13] 4 Three tactile pushbuttons (two for applications, one for reset). Ladislav Prskavec - Golang Prague #4, 4th Sep 2019 6

Slide 7

Slide 7 text

Ladislav Prskavec - Golang Prague #4, 4th Sep 2019 7

Slide 8

Slide 8 text

How to get micro:bit? Ladislav Prskavec - Golang Prague #4, 4th Sep 2019 8

Slide 9

Slide 9 text

Ladislav Prskavec - Golang Prague #4, 4th Sep 2019 9

Slide 10

Slide 10 text

Ladislav Prskavec - Golang Prague #4, 4th Sep 2019 10

Slide 11

Slide 11 text

TinyGo compiler architecture 4 GO SSA 4 LLVM IR Ladislav Prskavec - Golang Prague #4, 4th Sep 2019 11

Slide 12

Slide 12 text

Is tinyGo tiny? Ladislav Prskavec - Golang Prague #4, 4th Sep 2019 12

Slide 13

Slide 13 text

Hello World in IOT Ladislav Prskavec - Golang Prague #4, 4th Sep 2019 13

Slide 14

Slide 14 text

package main import ( "machine" "time" ) const led = machine.P1 func main() { led.Configure(machine.PinConfig{Mode: machine.PinOutput}) for { led.Low() time.Sleep(time.Second) led.High() time.Sleep(time.Second) } } Ladislav Prskavec - Golang Prague #4, 4th Sep 2019 14

Slide 15

Slide 15 text

TinyGO and WASM 4 Johan Brandhorst - Get Going with WebAssembly Ladislav Prskavec - Golang Prague #4, 4th Sep 2019 15

Slide 16

Slide 16 text

Ladislav Prskavec - Golang Prague #4, 4th Sep 2019 16

Slide 17

Slide 17 text

RISC-V 4 HiFive1 Rev B board 4 https://play.tinygo.org/ Ladislav Prskavec - Golang Prague #4, 4th Sep 2019 17

Slide 18

Slide 18 text

DEMOS 4 https://github.com/abtris/tinygo-talk-demos Ladislav Prskavec - Golang Prague #4, 4th Sep 2019 18

Slide 19

Slide 19 text

References 4 Ron Evans talks on 4 Gophercon 2019 4 Fosdem 2019 4 Ayke van Laëthem blog Ladislav Prskavec - Golang Prague #4, 4th Sep 2019 19

Slide 20

Slide 20 text

Warning new ESP8266/ESP32 WiFi vulnerabilities #infosec #IoT Ladislav Prskavec - Golang Prague #4, 4th Sep 2019 20

Slide 21

Slide 21 text

Q & A Or ask on twitter: @abtris Ladislav Prskavec - Golang Prague #4, 4th Sep 2019 21