Giter Club home page Giter Club logo

arduino_nus_host's Introduction

arduino_nus_host

An Arduino host example for my multilink NUS central role on nrf51. The following commands simplify NUS central role management from an enternal Arduino board. The project is intended to be composed by an Arduino board connected to an nrf51 module, flashed with my multilink NUS central software (https://github.com/marcorussi/nrf51_multi_nus_central), through UART interface.

Arduino UART TX and RX pins are respectively 9 and 8. See README file of multilink NUS central for nrf51 UART pins.

There are two main modes:

  • configuration mode: where received data are parsed as a command and executed if valid;
  • data mode: where data are sent directly through the last selected connection. At power up the device is in configuration mode.

Find serial commands here below:

  • "AT": query the module if it is running properly;
  • "SCAN": start a scan of devices and after stops it after a few seconds. Number of found devices is displayed on terminal. Then, it requires info (address and name) of each found devices and displays them on terminal;
  • "CONN=i": request a connection of device at index i. This index must be between 0 and n-1 devices where n is the number of found devices shown previously after a scan request. Upon successfull connection, any further received data wll be sent to the connected device (data mode);
  • "SWITCH=i": request to switch next data to device at index i. This implies that a previous successfull connection is established with that device. Then, any further received data wll be sent to the selected device (data mode);
  • "DROP=i": drop an established connection with device at index i. This implies that a previous successfull connection is established with that device. Upon disconnection, device is in configuration mode;
  • "AUTO": enter into data mode with the last valid device index. This implies that an escape character has been previously sent during the data mode of an established connection.

When the device is in data mode, it is possible to escape and so enter in command mode by sending "***" string. For entering back in data mode send the "AUTO" command as described above.

This software is still in progress and could drastically change in future.

arduino_nus_host's People

Contributors

marcorussi avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.