1

I'm trying to code my Arduino with Ruby. I'm currently trying Ardoo, but it seems it actively sends commands via USB. Is there a solution that doesn't require an active USB connection, and runs a self contained program instead? I suppose it would need to be a native compiler?

Max
  • 597
  • 7
  • 21

1 Answers1

0

I'm not an expert on this, but from what I've gathered ...

If you want to run Artoo code on your computer, removing the dependency of an actual Arduino device, you'll have to use "mocks" to "stub out" the device's responses.

Actually, you don't entirely need to mock out the Arduino. Pieces of the Artoo API can be run on a computer directly. For example, in my project artoo-keyboard-macros I connected to my laptop's keyboard with the following:

connection :keyboard, adaptor: :keyboard, port: '/dev/input/event3'
device :keyboard, driver: :keyboard, connection: :keyboard, port: '/dev/input/event3'

Anyway, if you have an actual Arduino, then you should install the code to it and run it from. Then there is no need for the laptop => usb => arduino connection in order to send commands. See arduino's docs on this

Community
  • 1
  • 1
max pleaner
  • 26,189
  • 9
  • 66
  • 118
  • To clarify: I'm trying to remove the laptop from the equation. I was under the impression the ruby script is actively sending commands, and not uploading an actual script to the arduino... No? – Max Jul 01 '16 at 06:46
  • My bad, I was thinking of the Raspberry Pi which can run Ruby code directly. There's instructions I think for how to upload code to Arduino on [their docs](http://artoo.io/documentation/platforms/arduino/) – max pleaner Jul 01 '16 at 07:13