The Arduino Nano is based on the AVR ATmega328p microcontroller.
Note: the AVR backend of LLVM is still experimental so you may encounter bugs.
Interface | Hardware Supported | TinyGo Support |
---|---|---|
GPIO | YES | YES |
UART | YES | YES |
SPI | YES | Not yet |
I2C | YES | YES |
ADC | YES | YES |
PWM | YES | YES |
Documentation for the machine package for the Arduino Nano
The Arduino Nano needs a few extra dependencies to work, for example, if you get an error like this:
/usr/lib/gcc/avr/5.4.0/../../../avr/bin/ld: cannot find -lm
/usr/lib/gcc/avr/5.4.0/../../../avr/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status
Or like this:
/bin/sh: 1: avrdude: not found
To fix this, see the installation guide for Linux and for macOS.
Programs are loaded onto the Arduino Uno using the avrdude
command line utility program. You must install this program before you will be able to flash the Arduino Uno board with your TinyGo code.
tinygo flash -target=arduino-nano