serialport

Version, currently master branch1 version
  • master branchlatestSep 29, 2020

github.com/makenowjust/serialport

serial port library for Crystal

4 stars
0 dependents
License: MIT

Installation

# Add this to your shard.yml
dependencies:
  serialport:
    github: makenowjust/serialport
    branch: master

master is a branch, not a release, so this tracks it rather than pinning a version.

Then run:

shards install

shard.yml

Crystal
0.35.1
License
MIT
Author
TSUYUSATO Kitsune

Dependencies

This version declares no dependencies.

README

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