All Projects → SolidSoils → Arduino

SolidSoils / Arduino

Licence: other
C# .NET - Arduino library supporting simultaneous serial ASCII, Firmata and I2C communication

Programming Languages

csharp
926 projects

Projects that are alternatives of or similar to Arduino

Johnny Five
JavaScript Robotics and IoT programming framework, developed at Bocoup.
Stars: ✭ 12,498 (+9513.85%)
Mutual labels:  arduino, serial, i2c
Diozero
Java Device I/O library that is portable across Single Board Computers. Tested with Raspberry Pi, Odroid C2, BeagleBone Black, Next Thing CHIP, Asus Tinker Board and Arduinos. Supports GPIO, I2C, SPI as well as Serial communication. Also known to work with Udoo Quad.
Stars: ✭ 167 (+28.46%)
Mutual labels:  arduino, serial, i2c
Pulsesensorstarterproject
The Best Way to Get Started with your PulseSensor and Arduino
Stars: ✭ 38 (-70.77%)
Mutual labels:  arduino, serial
Tinygo
Go compiler for small places. Microcontrollers, WebAssembly (WASM/WASI), and command-line tools. Based on LLVM.
Stars: ✭ 9,068 (+6875.38%)
Mutual labels:  arduino, i2c
Arduino Plotter
An Arduino library for easy graphing on host computer via serial communication
Stars: ✭ 129 (-0.77%)
Mutual labels:  arduino, serial
Web Bluetooth Terminal
Progressive Web Application for serial communication with your own Bluetooth Low Energy (Smart) devices
Stars: ✭ 130 (+0%)
Mutual labels:  arduino, serial
Pyquino
python3 serial port with PyQt5 Gui
Stars: ✭ 19 (-85.38%)
Mutual labels:  arduino, serial
Koduino
Arduino code for STM32 microcontrollers
Stars: ✭ 63 (-51.54%)
Mutual labels:  arduino, serial
Waterius
Передача показаний воды по Wi-Fi. Watermeter Wi-Fi transmitter.
Stars: ✭ 295 (+126.92%)
Mutual labels:  arduino, i2c
Noduino
JavaScript and Node.js Framework for controlling Arduino with HTML and WebSockets
Stars: ✭ 1,202 (+824.62%)
Mutual labels:  arduino, serial
Serial Studio
Multi-purpose serial data visualization & processing program
Stars: ✭ 1,168 (+798.46%)
Mutual labels:  arduino, serial
Arduino Robust Serial
A simple and robust serial communication protocol. It was designed for Arduino but can be used for other purposes (e.g. bluetooth, sockets). Implementation in C Arduino, C++, Python and Rust.
Stars: ✭ 83 (-36.15%)
Mutual labels:  arduino, serial
Cylon
JavaScript framework for robotics, drones, and the Internet of Things (IoT)
Stars: ✭ 3,862 (+2870.77%)
Mutual labels:  arduino, i2c
Heatpump
Arduino library to control Mitsubishi Heat Pumps via connector cn105
Stars: ✭ 327 (+151.54%)
Mutual labels:  arduino, serial
Eprom
Python script and Arduino code for burning eproms
Stars: ✭ 35 (-73.08%)
Mutual labels:  arduino, serial
Ssd1306
Driver for SSD1306, SSD1331, SSD1351, IL9163, ILI9341, ST7735, PCD8544, Nokia 5110 displays running on Arduino/ESP32/Linux (Rasperry) platforms
Stars: ✭ 303 (+133.08%)
Mutual labels:  arduino, i2c
Victron.arduino Esp8266
Code to read the VE.Direct-Protocol from serial into a value array. Uses a non-blocking read loop and does checksum verification before adding the data.
Stars: ✭ 54 (-58.46%)
Mutual labels:  arduino, serial
Arduinoosc
OSC subscriber / publisher for Arduino
Stars: ✭ 106 (-18.46%)
Mutual labels:  arduino, serial
jacdac-ts
Jacdac TypeScript library
Stars: ✭ 17 (-86.92%)
Mutual labels:  serial, i2c
pigpio-client
A nodejs client for pigpio socket interface.
Stars: ✭ 24 (-81.54%)
Mutual labels:  serial, i2c

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)

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

Currently Standard Firmata 2.5 is supported. (Extra capabilities of Standard Firmata Plus and Configurable Firmata are currently not supported by this client library.)

Technology: Microsoft .NET/C# v4.5

Dependencies: none

Downloads

The library is available as a NuGet package.

API Documentation

See reference documentation.

Getting started

Setup your Arduino with StandardFirmata

  1. Download the Arduino IDE and install it.
  2. Connect your Arduino board to your computer using an USB cable.
  3. Start the Arduino IDE and navigate to File > Examples > Firmata > StandardFirmata.
  4. Upload the sketch.

Basic test (C#)

Preparation

  • Your Arduino is setup with the StandardFirmata sketch (see above).
  • An LED is connected to pin 10 of your Arduino.

Further steps

  1. Open Visual Studio and create a new C# console program project.
  2. Add NuGet package SolidSoils.Arduino.Client.
  3. In Program.cs put the following code:
using System;
using Solid.Arduino.Firmata;

namespace Demo
{
    class Program
    {
        static void Main(string[] args)
        {
            ISerialConnection connection = GetConnection();

            if (connection != null)
                using (var session = new ArduinoSession(connection))
                    PerformBasicTest(session);

            Console.WriteLine("Press a key");
            Console.ReadKey(true);
        }

        private static ISerialConnection GetConnection()
        {
            Console.WriteLine("Searching Arduino connection...");
            ISerialConnection connection = EnhancedSerialConnection.Find();

            if (connection == null)
                Console.WriteLine("No connection found. Make shure your Arduino board is attached to a USB port.");
            else
                Console.WriteLine($"Connected to port {connection.PortName} at {connection.BaudRate} baud.");

            return connection;
        }

        private static void PerformBasicTest(IFirmataProtocol session)
        {
            var firmware = session.GetFirmware();
            Console.WriteLine($"Firmware: {firmware.Name} version {firmware.MajorVersion}.{firmware.MinorVersion}");
            var protocolVersion = session.GetProtocolVersion();
            Console.WriteLine($"Firmata protocol version {protocolVersion.Major}.{protocolVersion.Minor}");

            session.SetDigitalPinMode(10, PinMode.DigitalOutput);
            session.SetDigitalPin(10, true);
            Console.WriteLine("Command sent: Light on (pin 10)");
            Console.WriteLine("Press a key");
            Console.ReadKey(true);
            session.SetDigitalPin(10, false);
            Console.WriteLine("Command sent: Light off");
        }
    }
}

Display board capabilities

Preparation

  • Your Arduino is setup with the StandardFirmata sketch (see above).
  • In this example the Arduino is connected to COM3 at 57600 baud. Modify as needed.

Further steps

  1. Open Visual Studio and create a new C# console program project.
  2. Add NuGet package SolidSoils.Arduino.Client.
  3. In Program.cs put the following code:
using System;
using Solid.Arduino.Firmata;

namespace Demo
{
    class Program
    {
        static void Main(string[] args)
        {
            DisplayPortCapabilities();
            Console.WriteLine("Press a key");
            Console.ReadKey(true);
        }

        private static void DisplayPortCapabilities()
        {
            using (var session = new ArduinoSession(new EnhancedSerialConnection("COM3", SerialBaudRate.Bps_57600)))
            {
                BoardCapability cap = session.GetBoardCapability();
                Console.WriteLine();
                Console.WriteLine("Board Capability:");

                foreach (var pin in cap.Pins)
                {
                    Console.WriteLine("Pin {0}: Input: {1}, Output: {2}, Analog: {3}, Analog-Res: {4}, PWM: {5}, PWM-Res: {6}, Servo: {7}, Servo-Res: {8}, Serial: {9}, Encoder: {10}, Input-pullup: {11}",
                        pin.PinNumber,
                        pin.DigitalInput,
                        pin.DigitalOutput,
                        pin.Analog,
                        pin.AnalogResolution,
                        pin.Pwm,
                        pin.PwmResolution,
                        pin.Servo,
                        pin.ServoResolution,
                        pin.Serial,
                        pin.Encoder,
                        pin.InputPullup);
                }
            }
        }
    }
}

Current status

v0.5

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.
  7. NuGet package published.

License

BSD-2 license

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].