An open API service indexing awesome lists of open source software.

https://github.com/josephschito/rubyduino

Rubyduino compiles Ruby code for Arduino UNO boards and uploads the generated firmware.
https://github.com/josephschito/rubyduino

arduino artoo rad ruby

Last synced: 7 days ago
JSON representation

Rubyduino compiles Ruby code for Arduino UNO boards and uploads the generated firmware.

Awesome Lists containing this project

README

          

# Rubyduino

image copy

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

IMG_0197

```ruby
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

```bash
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:

```bash
brew tap osx-cross/avr
brew install avr-gcc avrdude
```

On Debian/Ubuntu:

```bash
sudo apt install gcc-avr avr-libc avrdude
```

On Fedora:

```bash
sudo dnf install avr-gcc avr-libc avrdude
```

## Usage

```bash
rubyduino examples/hello.rb
```

Pass a serial port explicitly when auto-detection is not enough:

```bash
rubyduino -p /dev/cu.usbmodem11401 examples/hello.rb
```

## License

MIT