Pages: [1]   Go Down
Author Topic: Receive Only Software Serial (Now with files)  (Read 456 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 1
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello! I have started projects where I do not need to transmit serial data however the serial library still forces me to declare both a TX and RX pin. I modified the Software Serial library to only receive data and was able to save about 500 bytes (and a pin!) on my ATtiny85. The modifications were inspired by Nick Gammon's SendOnlySoftwareSerial (which works great!) http://forum.arduino.cc/index.php?topic=112013.0

Unfortunately, I am not a lawyer and I am unsure of the proper etiquette on how to mark my changes if I were to "publish" the modified libraries. If I could get some guidance, I would love to contribute this library (it is still being tested though!).

Edit:
I have tested  the library and it seems to work. Just make a folder called ReceiveOnlySoftwareSerial and place the three attached folders into it. Then place that folder into your arduino/sketchbook/ibrary folder to "install". It works exactly the same as SoftwareSerial except you only need to specify one receiver pin during initialization. This is also my first modified library, any pointers/tips would be GREATLY appreciated!

* ReceiveOnlySoftwareSerial.cpp (11.94 KB - downloaded 10 times.)
* ReceiveOnlySoftwareSerial.h (3.42 KB - downloaded 9 times.)
* keywords.txt (0.59 KB - downloaded 8 times.)
« Last Edit: May 17, 2014, 06:29:15 am by whiteglint143 » Logged

Atlanta, USA
Offline Offline
Edison Member
*
Karma: 53
Posts: 1776
AKA: Ray Burne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Just follow Nick's example.  Not being a lawyer is, IMO, a good thing!
Quote
Code:
SendOnlySoftwareSerial - adapted from SoftwareSerial by Nick Gammon 28th June 2012

SoftwareSerial.h (formerly NewSoftSerial.h) -
Multi-instance software serial library for Arduino/Wiring
-- Interrupt-driven receive and other improvements by ladyada
   (http://ladyada.net)
-- Tuning, circular buffer, derivation from class Print/Stream,
   multi-instance support, porting to 8MHz processors,
   various optimizations, PROGMEM delay tables, inverse logic and
   direct port writing by Mikal Hart (http://www.arduiniana.org)
-- Pin change interrupt macros by Paul Stoffregen (http://www.pjrc.com)
-- 20MHz processor support by Garrett Mace (http://www.macetech.com)
-- ATmega1280/2560 support by Brett Hagman (http://www.roguerobotics.com/)

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

*/

#ifndef SendOnlySoftwareSerial_h
#define SendOnlySoftwareSerial_h
Logged

Pages: [1]   Go Up
Jump to: