Code Monkey home page Code Monkey logo

arduino's Introduction

SolidSoils4Arduino

SolidSoils4Arduino is a client library built on the .NET Framework 4.5 and providing an easy way to interact with Arduino boards. The library implements the main communication protocols, the first of which is the Firmata protocol. It aims to make communication with Arduino boards in MS .NET projects easier through a comprehensive and consistent set of methods and events.

The library supports the following protocols:

  1. Serial (ASCII) messaging
  2. Firmata
  3. I2C (as it has become part of Firmata)

The protocols mentioned can be used simultaneously. The library brokers all incoming message types and directs them to the appropriate requestors (synchronous as well as asynchronous) and events.

Technology used: Microsoft .NET/C# v4.5

A basic code example

using Solid.Arduino.Firmata;

(...)

var connection = new SerialConnection("COM3", SerialBaudRate.Bps_57600);
var session = new ArduinoSession(connection, timeOut: 250);
// Cast to interface done, just for the sake of this demo.
IFirmataProtocol firmata = (IFirmataProtocol)session;

Firmware firm = firmata.GetFirmware();
Console.WriteLine("Firmware: {0} {1}.{2}", firm.Name, firm.MajorVersion, firm.MinorVersion);

ProtocolVersion version = firmata.GetProtocolVersion();
Console.WriteLine("Protocol version: {0}.{1}", version.Major, version.Minor);

BoardCapability caps = firmata.GetBoardCapability();
Console.WriteLine("Board Capabilities:");

foreach (var pincap in caps.PinCapabilities)
{
    Console.WriteLine("Pin {0}: Input: {1}, Output: {2}, Analog: {3}, Analog-Res: {4}, PWM: {5}, PWM-Res: {6}, Servo: {7}, Servo-Res: {8}",
        pincap.PinNumber,
		pincap.DigitalInput,
		pincap.DigitalOutput,
		pincap.Analog,
		pincap.AnalogResolution,
		pincap.Pwm,
		pincap.PwmResolution,
        pincap.Servo,
		pincap.ServoResolution);
}
Console.WriteLine();
Console.ReadLine();

Current status

v0.2

Code complete for the library core. (Beta)

Milestones

  1. Firmata protocol implemented, unit- and integration-tested.
  2. I2C protocol implemented and unit-tested.
  3. Serial ASCII protocol implemented and unit-tested.
  4. API fully documented.
  5. IObservable methods implemented (to be unittested).
  6. Mono support added.

Upcoming

  1. Finish unit tests for latest additions.
  2. Develop a WPF application demonstrating the library (project Solid.Arduino.Monitor).
  3. Release the first version.

Contributing

If you discover a bug or would like to propose a new feature, please open a new issue.

To contribute, fork this respository and create a new topic branch for the bug, feature or other existing issue you are addressing. Submit the pull request against the master branch.

If you would like to contribute but don't have a specific bugfix or new feature to contribute, you can take on an existing issue. Add a comment to the issue to express your intent to begin work and/or to get any additional information about the issue.

Please, test your contributed code thoroughly. In your pull request, describe tests performed to ensure that no existing code is broken and that any changes maintain backwards compatibility with the existing API.

arduino's People

Contributors

formator avatar solidsoils 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.