SoftwareSerial equivalent library for Z-Uno

Tips, Tricks and Scripts to enhance your home automation and workaround known device bugs, limitations and incompatibilities
Post Reply
Steve_Elves
Posts: 14
Joined: 07 Aug 2022 21:54

SoftwareSerial equivalent library for Z-Uno

Post by Steve_Elves »

I want to connect to an A02YYUW ultrasonic distance sensor. The one I have works with my Arduino Uno but needs a library called SoftwareSerial.h. Does anyone know if this library is compatible with the Z-Uno? If not, is there an equivalent that someone has successfully used?

I've tried to bring in the Arduino version but I'm having trouble getting it to work. Any help/suggestions greatly appreciated!
User avatar
PoltoS
Posts: 7062
Joined: 26 Jan 2011 19:36

Re: SoftwareSerial equivalent library for Z-Uno

Post by PoltoS »

Z-Uno 2 does not have such SoftwareSerial.h (the Z-Uno 1 had it), but you don't need it anymore as Z-Uno can do hardware serial at a much slower baud rate than before. Please try to use standard serial instead.
Steve_Elves
Posts: 14
Joined: 07 Aug 2022 21:54

Re: SoftwareSerial equivalent library for Z-Uno

Post by Steve_Elves »

Ah, thanks PoltoS! I am presuming therefore that I can use the "HardwareSerial.h" library, connecting TX to pin 7 and RX to pin 8. Is this correct? Can you suggest anything else I should do to make this work?

Do you have somewhere an example sketch showing the A02YYUW in use?
User avatar
alexis92
Posts: 18
Joined: 28 Apr 2022 15:59

Re: SoftwareSerial equivalent library for Z-Uno

Post by alexis92 »

I'd love to hear if the HardwareSerial header worked out for you, or if you ran into any more issues.
Steve_Elves
Posts: 14
Joined: 07 Aug 2022 21:54

Re: SoftwareSerial equivalent library for Z-Uno

Post by Steve_Elves »

Alexis:
I should have updated the post - yes, HardwareSerial worked just fine - I'm happily receiving 4 bytes of validated data from the A02YYUW.
I'm having problems displaying the results correctly on the LCD - I have a 2x16 standard LCD hooked up using I2C, but the data isn't appearing correctly on the screen (I just get a garbage character). I'm sure it's a problem with my code, since the serial monitor shows the values correctly.
I'm using the ZUNO_LCD library - is there another library that you know of that will work with Z-Uno?
Post Reply