RasPiComm Logo - Sample applications

After you have installed and set up your RasPiComm, you are ready for some sample applications!

To use these sample applications, you need to have GIT installed. Install it with this command:

sudo apt-get install git

Sample apps for C

Repository on Github: rpc-examples

This repository includes small example applications that use the RS-485 port of the RasPiComm. Here is how to use it:
  1. Use GIT to clone this repository to your Raspberry Pi:

    git clone https://github.com/amescon/rpc-examples.git

  2. The repository includes the following sample apps:
    • rs485_write
      Sends "Hello World" over the RS-485 port.
    • rs485_read
      Receives 10 bytes from the RS-485 port and displays them afterwards.
    • rs485_poll
      A more sophisticated version of rs485_read that uses the poll() system call to wait for RS-485 data and keyboard events at the same time without consuming cpu time.
  3. Change to the directory of the application that you want to run, e.g.:

    cd rpc-examples/rs485_write

  4. Compile the code into an executable:

    make

  5. Run it, e.g.:

    ./rs485_write

  6. Time to have some fun! Modify the code, compile it once more and test your changes!

Sample apps for C#

Repository on Github: rpc-mono-examples

This repository includes small Mono example applications in C# that use the RS-485 port of the RasPiComm. Here is how to use it:
  1. You will need Mono to use these applications. To install Mono, use this command:

    sudo apt-get install mono-mcs

  2. Use GIT to clone the repository to your Raspberry Pi:

    git clone https://github.com/amescon/rpc-mono-examples.git

  3. The repository includes the following sample apps:
    • Rs485Write
      Sends "Hello World" over the RS-485 port.
    • Rs485Read
      Receives 10 bytes from the RS-485 port and displays them afterwards.
  4. Change to the directory of the application that you want to run, e.g.:

    cd rpc-mono-examples/Rs485Write

  5. Compile the code into an executable:

    make

  6. Run it, e.g.:

    ./rs485_write

  7. Time to have some fun! Modify the code, compile it once more and test your changes!

Sample apps for Python

Repository on Github: rpc-python-examples

This repository includes small python example applications that use the RS-485 port of the RasPiComm. Here is how to use it:
  1. You will need the pyserial python module to use these applications. To install use these commands:

    wget https://pypi.python.org/packages/source/p/pyserial/pyserial-2.6.tar.gz
    tar zxvf pyserial-2.6.tar.gz
    cd pyserial-2.6/
    sudo python setup.py install

  2. Use GIT to clone the repository to your Raspberry Pi:

    git clone https://github.com/amescon/rpc-python-examples.git

  3. The repository includes the following sample apps:
    • rs485_read
      Receives 10 bytes from the RS-485 port and displays them afterwards.
  4. Change to the directory of the application that you want to run:

    cd rpc-python-examples/rs485_read/

  5. Run the python code:

    ./rs485_read.py

  6. Time to have some fun! Modify the code and test your changes!
Twitter Github Tumblr PInterest Youtube