SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Apr 2008
    0 Post(s)
    0 Thread(s)

    How to send binary data to srial com port of a pc using ror..

    Hi everyone,
    I'm new to ROR, and would like to ask for guidance how to send binary data to serial port to light an LED..

    thanks in advance,

  2. #2
    SitePoint Enthusiast AllTom's Avatar
    Join Date
    Feb 2008
    Wherever danger lies...
    0 Post(s)
    0 Thread(s)
    Do you already have the LED panel purchased? What brand/type is it? Which platform is the RoR server running on?

    You can either find a serial library for Ruby that's appropriate and control the LED in the CODE for your actions (not recommended), write a Ruby script that you can spawn with DRb or similar (so that users aren't kept waiting for the serial communication to finish), or find/write an external program which you can invoke from within Ruby for controlling the LED.

    I would recommend trying all Ruby-solutions first for project cohesion, but if you already have other (C?) programs for controlling the LEDs working, it's probably easier to spawn that program from within Rails instead.
    There are some things you shouldn't try to code at home.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts