Skip to content

makenowjust/serialport

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

serialport

serial port library for Crystal

Installation

Add this to your application's shard.yml:

dependencies:
  serial-port:
    github: MakeNowJust/serialport

Usage

require "serialport"

# Create a serial port connection.
serial = SerialPort.new "/dev/your-serialport", Termios::BaudRate::B9600

# `SerialPort` inherits from `IO`,
# so you can write text to the serial port with `<<` method.
serial << "Hello world!"

# And, you can read from the serial port with `gets` method.
loop do
  puts serial.gets
  sleep 0.1
end

TODO

  • Write specs
  • Make more configurable (currently, baudrate only)
  • Support more platforms

Contributing

  1. Fork it (https://github.com/MakeNowJust/serialport/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributor

License and Copyright

MIT and 🍣 © TSUYUSATO "MakeNowJust" Kitsune <make.just.on@gmail.com> 2016

About

serial port library for Crystal

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published