Sending a message to the Arduino using serial communication

First of all make sure have uploaded the serial code to the Arduino. I used the code from todbot.com which blinks the LED a number of times depending upon the serial value passed over to it.

require 'serialport'

sp = SerialPort.new "/dev/ttyUSB0", 9600
sp.write "6"

Within an irb session I pasted the above code into it and I observed the LED on pin 13 blink 6 times.

Resources

Tags:
Source:
1838hrs.txt
Published:
22-04-2012 18:38