GithubHelp home page GithubHelp logo

opensprints-hw-js's Introduction

This project hosts the OpenSprints USB hub as a RESTful web service.

The hall effect sensors are monitored, LEDs are controlled, and a state machine switches between two states:

  • "waiting": magnets are ignored
  • "counting": magnets switching the hall sensors on and off, causing counters to increment.

A client can monitor the rollers' ticks and transition the state machine between the two states by making HTTP requests.

Here is a client library that is designed to interact with the Siren hypermedia media type.

Running the service:

  1. Install the node dependencies.

  2. Make sure the StandardFirmata sketch is flashed on the OpenSprints USB device's Arduino.

  3. Connect the OpenSprints USB device.

  4. Run:

    node index.js
    

    Depending on which port the Arduino is mounted to, the command may need to be run by the root user:

    sudo node index.js
    
  5. Open http://browser.zettajs.io/#/overview?url=http:%2F%2F127.0.0.1:1337

    This a JavaScript client running in the browser, making requests to the USB monitor running as a RESTful web service API.

    Click on the "start" button under "State Machine Device". The magnet sensor should cause incrementing ticks for the associated "roller" until the State Machine Device's "stop" button is pressed.

opensprints-hw-js's People

Contributors

lukeorland avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

opensprints-hw-js's Issues

Rename index.js to example.js, create Hw class

  • create a Hw class in a new hw.js file that example.js imports from, and consumers of this package will import
  • the constructor has a port parameter, with default value 1337
  • update the value for "main" in package.json.

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.