# Rubyduino
[Experimental]
Rubyduino compiles Ruby sketches for Arduino boards and uploads the generated firmware.
Under the hood it uses [Spinel](https://github.com/matz/spinel), a Ruby AOT compiler, vendored at a pinned revision.
Example
pin_mode(ArduinoUNO::LED_BUILTIN, ArduinoUNO::OUTPUT)
loop do
digital_write(ArduinoUNO::LED_BUILTIN, ArduinoUNO::HIGH)
delay_ms(100)
digital_write(ArduinoUNO::LED_BUILTIN, ArduinoUNO::LOW)
delay_ms(100)
end
Not bad, huh?
Installation
gem install rubyduino
The command expects the AVR toolchain to be available in PATH, including avr-gcc, avr-objcopy, and avrdude.
On macOS, install the AVR tools with Homebrew:
brew tap osx-cross/avr
brew install avr-gcc avrdude
On Debian/Ubuntu:
sudo apt install gcc-avr avr-libc avrdude
On Fedora:
sudo dnf install avr-gcc avr-libc avrdude
Usage
rubyduino examples/hello.rb
Pass a serial port explicitly when auto-detection is not enough:
rubyduino -p /dev/cu.usbmodem11401 examples/hello.rb
License
MIT