All Projects → asukiaaa → SomeSerial

asukiaaa / SomeSerial

Licence: other
An Arduino library to wrap multiple kind of serials.

Programming Languages

C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to SomeSerial

Grove LoRa 433MHz and 915MHz RF
No description or website provided.
Stars: ✭ 26 (+85.71%)
Mutual labels:  arduino-library
SparkFun CAN-Bus Arduino Library
No description or website provided.
Stars: ✭ 132 (+842.86%)
Mutual labels:  arduino-library
CoopThreads
Lightweight, platform agnostic, stackful cooperative threads library.
Stars: ✭ 18 (+28.57%)
Mutual labels:  arduino-library
ArduinoSpritzCipher
Spritz encryption system portable C library, CSPRNG, cryptographic hash and MAC functions, symmetric-key data encryption, and general-purpose functions. It's also an Arduino library.
Stars: ✭ 67 (+378.57%)
Mutual labels:  arduino-library
OpenWeather
Arduino library to fetch weather forecasts from OpenWeatherMap
Stars: ✭ 88 (+528.57%)
Mutual labels:  arduino-library
AnalogPHMeter
Arduino Library for analog pH meter.
Stars: ✭ 20 (+42.86%)
Mutual labels:  arduino-library
Arduino-Debug
On-target sketch debugger for Arduino
Stars: ✭ 20 (+42.86%)
Mutual labels:  arduino-library
LiquidCrystal I2C Hangul
아두이노 16x2 LCD 한글 출력 라이브러리
Stars: ✭ 16 (+14.29%)
Mutual labels:  arduino-library
SparkFun TB6612FNG Arduino Library
No description or website provided.
Stars: ✭ 40 (+185.71%)
Mutual labels:  arduino-library
frt
Lightweight, easy-to-use wrapper around the Arduino_FreeRTOS_Library
Stars: ✭ 18 (+28.57%)
Mutual labels:  arduino-library
Somfy Remote Lib
Emulate a Somfy remote using a 433.42 MHz transmitter.
Stars: ✭ 43 (+207.14%)
Mutual labels:  arduino-library
EthernetENC
Ethernet library for ENC28J60. This is a modern version of the UIPEthernet library. EthernetENC library is compatible with all Arduino architectures with Arduino SPI library with transactions support. Only include EthernetENC.h instead of Ethernet.h
Stars: ✭ 58 (+314.29%)
Mutual labels:  arduino-library
SensorFusion
A simple implementation of some complex Sensor Fusion algorithms
Stars: ✭ 101 (+621.43%)
Mutual labels:  arduino-library
SparkFun VL53L1X Arduino Library
A library for the laser based VL53L1X Time Of Flight distance sensor capable of detecting a target 4m away!
Stars: ✭ 57 (+307.14%)
Mutual labels:  arduino-library
MAX31855
Arduino library for 14-bit MAX31855 K-thermocouple to digital converter
Stars: ✭ 20 (+42.86%)
Mutual labels:  arduino-library
HCSR04
Arduino library for HC-SR04, HC-SRF05, DYP-ME007, BLJ-ME007Y, JSN-SR04T ultrasonic ranging sensor
Stars: ✭ 27 (+92.86%)
Mutual labels:  arduino-library
arduino-dataflash
Support for Atmel Dataflash for the Arduino
Stars: ✭ 23 (+64.29%)
Mutual labels:  arduino-library
esp8266ndn
NDN Arduino library for ESP8266 and more
Stars: ✭ 18 (+28.57%)
Mutual labels:  arduino-library
HomeSpan
HomeKit Library for the Arduino-ESP32
Stars: ✭ 410 (+2828.57%)
Mutual labels:  arduino-library
WiFiConnect
WiFi connection manager for ESP32 and ESP8266 with OLED support
Stars: ✭ 28 (+100%)
Mutual labels:  arduino-library

SomeSerial Build Status

An Arduino library to wrap multiple kinds of serials.

Before using this library, consider using Stream class to handle multiple kinds of serials.

#include <SoftwareSerial.h>

SoftwareSerial softSerial(10, 11); // RX, TX

void printStream(Stream* serial) {
  serial->print("hi at ");
  serial->println(millis());
}

void setup() {
  Serial.begin(115200);
  softSerial->begin(115200);
}

void loop() {
  printStream(&Serial);
  printStream(&softSerial);
  delay(1000);
}

Usage

Include

#include "SomeSerial.h"

Definition

USB Serial or HardwareSerial

For popular Arduino family.

SomeSerial someSerial(&Serial);

For official Arduino SAMD boards. (SAMD boards by Adafruit use Serial.)

SomeSerial someSerial(&SerialUSB);

SoftwareSerial

SomeSerial someSerial(10, 11); // RX, TX

or

SoftwareSerial mySoftwareSerial(10, 11); //RX, TX
SomeSerial someSerial(&mySoftwareSerial);

Be careful that not all pins support SofwareSerial.

Please check or test whether using pins for SoftwareSerial work or not.

SoftwareSerial

ArduinoProducts

ARM and ESP32 does not support SoftwareSerial.

Use like Serial

void setup() {
  someSerial.begin(115200);
}

void loop() {
  someSerial.println("Hello world!");
  delay(1000);
}

As HardwareSerial

if (someSerial->isHardwareSerial()) {
  someSerial->println("It is HardwareSerial");
  someSerial->thisHardwareSerial->println("Direct print to HardwareSerial");

}

As SoftwareSerial

if (someSerial->isSoftwareSerial()) {
  someSerial->println("It is SoftwareSerial");
  someSerial->thisSoftwareSerial->println("Direct print to SoftwareSerial");
}

As USBAPI Serial_

if (someSerial->isSerial_()) {
  someSerial->println("It is USBAPI Serial_");
  someSerial->thisSerial_->println("Direct print to USBAPI Serial_");
}

License

MIT

References

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].