ledongthuc / customsoftwareserial Goto Github PK
View Code? Open in Web Editor NEWAlternative SoftwareSerial in Arduino. CustomSoftwareSerial library allow to configure and custom Parity Bit and Stop Bit.
License: MIT License
Alternative SoftwareSerial in Arduino. CustomSoftwareSerial library allow to configure and custom Parity Bit and Stop Bit.
License: MIT License
Missing .Listen function. SoftwareSerial use this to handle 2 ports. With customSoftwareSerial i cant use with 2 ports. can you help? what is to do?
Hi
wanted to use this with Modbus
but got an error
Did I miss anything:
C:\Users\xxx\Documents\Arduino\libraries\ModbusMaster\src/ModbusMaster.h:74:10: note: candidate: void ModbusMaster::begin(uint8_t, Stream&) void begin(uint8_t, Stream &serial); ^~~~~ C:\Users\xxx\Documents\Arduino\libraries\ModbusMaster\src/ModbusMaster.h:74:10: note: no known conversion for argument 2 from 'CustomSoftwareSerial*' to 'Stream&' exit status 1 no matching function for call to 'ModbusMaster::begin(int, CustomSoftwareSerial*&)'
defined:
SoftSer1->begin(9600, SERIAL_8N2); //custom software serial node.begin(1, SoftSer1);
Error:
`Arduino: 1.8.13 (Windows Store 1.8.42.0) (Windows 10), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"
...error: no matching function for call to 'ModbusMaster::begin(int, CustomSoftwareSerial*&)'
node.begin(1, SoftSer1);
C:\Users\xxx\Documents\Arduino\libraries\ModbusMaster\src/ModbusMaster.h:74:10: note: candidate: void ModbusMaster::begin(uint8_t, Stream&)
void begin(uint8_t, Stream &serial);
^~~~~
C:\Users\xxx\Documents\Arduino\libraries\ModbusMaster\src/ModbusMaster.h:74:10: note: no known conversion for argument 2 from 'CustomSoftwareSerial*' to 'Stream&'
exit status 1
no matching function for call to 'ModbusMaster::begin(int, CustomSoftwareSerial*&)'
`
Hi, would you be able to help me set the delay array data for a baud rate of 100000?
Thanks!
How can I use this bibliotheque for ESP8266 & ESP32 ?
First of all, I wanted to thank you for the library, very helpful. It is unbelievable that Arduino has so many constraints in terms of communication.
Right now, I'm using your library, but I'm having troubles with the baudrate. I can only have good data a 9600 bps. Changing to 115200 everything is just garbage. Unfortunately, my application does not allow something less that 115200 bps. In order to test the library, I did the following program. The following code uses the default pins (0,1) to transmit the word "Hello world". But I only get reliable data at 9600. Any answer will be much appreciated it.
#include <CustomSoftwareSerial.h>
CustomSoftwareSerial* customSerial; // Declare serial
CustomSoftwareSerial* customSerial1;
//#include <SoftwareSerial.h>
#include <stdint.h>
//SoftwareSerial portOne(10, 11); // RX, TX
unsigned int read_val=0;
void setup()
{
//Serial.begin(115200);
while (!Serial)
{
; // wait for serial port to connect. Needed for native USB port only
}
delay(10);
customSerial = new CustomSoftwareSerial(10, 11); // rx, tx
customSerial1 = new CustomSoftwareSerial(0, 1); // rx, tx
customSerial1->begin(14400, CSERIAL_8N1);
customSerial->begin(115200, CSERIAL_8N1); // Baud rate: 9600, configuration: CSERIAL_8N1
//portOne.begin(115200);
delay(1000);
//portOne.print(50,HEX);
customSerial->print(50,HEX);
customSerial1->print("Hello world");
}
void loop()
{
while(true)
{
if (customSerial->available())
{
read_val=customSerial->read();
Serial.println(read_val);
//Serial.println("Hello");
}
}
}
Greetings, the problem I have is that in the connection to 9600 bit 7 even parity, it does not capture the data correctly, if you could help me with that, I would be grateful.
Hi
this variable is never used: uint8_t maxValueOfData
look at: CustomSoftwareSerial.cpp, Row:477:11
uint8_t maxValueOfData = round(pow(2, this->_numberOfDataBit - 1));
Thanks & Regards
507 writeParityBits(numberOfBits1);
508 tunedDelay(_tx_delay);
↓↓↓↓↓↓↓↓↓↓
507 writeParityBits(numberOfBits1);
508 if(this->_parityBit != NONE) {
509 tunedDelay(_tx_delay);
510 }
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.