Code Monkey home page Code Monkey logo

reglocpf's Introduction

Reglo-CPF

Arduino controller for the Reglo-CPF digital pump.

Installation

Download the library by using the Download Zip button to the right and decompress the zip. Rename the decompressed folder to reglocpf and copy it into your Arduino/libraries folder.

Usage

To use the controller, create an instance of the RegloCPF class using a Stream-like object as the first parameter (typically Serial) and the address of the pump as the second parameter (typically 1):

#include <RegloCPF.h>

// Create a RegloCPF controller using the default address.
RegloCPF pump(&Serial, 1);

Note that the library does not initialise the serial port for you, you must do this as part of your setup routine. The Reglo-CPF uses the same default settings as the Arduino (9600-baud, 8-bit, 1 stop bit, no parity).

Now, you can use the methods of the pump object to control the Reglo-CPF digital pump. For example, to start and then stop the pump:

// Attempt to start the pump, if an error occurs display the light.
if (pump.start() != REGLO_OK) {
    digitalWrite(PIN_LED, HIGH);
} else {

    // Wait for a second.
    delay(1000);
    
    // Attempt to stop the pump, again displying the light if an error
    // occurs.
    if (pump.stop() != REGLO_OK) {
        digitalWrite(PIN_LED, HIGH);
    }

}

All control methods return a value indicating whether the command was successful, and if not, where possible why not. Documentation for these return values can be found in RegloCPF.h.

Further examples are included with the library.

Development

The functionality in the library is fairly minimal, and the priority is to implement features that we need for an experiment first. After this, I'll work through and test the remainder of the protocol from the Reglo-CPF manual.

reglocpf's People

Watchers

James Cloos avatar Brett Lempereur 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.