Upgrade to Pro — share decks privately, control downloads, hide ads and more …

TinyGo

 TinyGo

Presentation about TinyGo (https://tinygo.org) using Micro:bit microcontroller for demos.

Ladislav Prskavec

September 04, 2019
Tweet

More Decks by Ladislav Prskavec

Other Decks in Technology

Transcript

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  6. 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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  14. 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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  19. 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

    View full-size slide

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

    View full-size slide

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

    View full-size slide