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 Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View 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 Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View 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 Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View 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 Slide

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

    View Slide

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

    View Slide