-
-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Software serial support #20
Comments
Hi Sasank, The library is flexible enough to let you use SoftwareSerial without any changes to the library itself. inline void beginToSerial1()
{
begin([](void *p, const void *b, int s) -> int { return Serial1.write((const uint8_t *)b, s); },
[](void *p, void *b, int s) -> int { return Serial1.readBytes((uint8_t *)b, s); });
} Thus, instead of calling #include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 3);
...
proto.begin([](void *p, const void *b, int s) -> int { return mySerial.write((const uint8_t *)b, s); },
[](void *p, void *b, int s) -> int { return mySerial.readBytes((uint8_t *)b, s); }); Let me know, if you have any issues with the example above. Best regards, |
Thank you @lexus2k , |
Hi @lexus2k & contributors,
I have a situation where I want to reliably send high-speed data from RPi and Arduino.
The problem is I am using an Arduino Nano which has one HW Serial.
The problem is I cannot connect the RPi to the HW Serial because it creates issues in uploading
sketches with the Serial USB, so I am using Software Serial to communicate with the Pi.
Now exploring very few solutions I stumped across this beautiful library as it will serve the purpose
of the Pi communicating with TinyProto in python as well.
But I see now the library uses only Hardware Serial library and provides hardware redirects
beginToSerialX() wehre X-> No of serial ports.
Is there any issue with adding something like
beginToSoftwareSerial(Rx, Tx).
and begin with SoftwareSerial.Please let me know if is possible through some code hack in the stable version.
I would really like to see this as an official feature.
Let me know what you think about it.
Thank you,
Sasank Panda
The text was updated successfully, but these errors were encountered: