NewSoftSerial

A New Software Serial Library for Arduino

News: NewSoftSerial is in the core!  Starting with Arduino 1.0 (December, 2011), NewSoftSerial has replaced the old SoftwareSerial library as the officially supported software serial library.  This means that if you have 1.0 or later, you should not download this library.  To port your code to 1.0, simply change all NewSoftSerial references to SoftwareSerial.

NewSoftSerial is the latest of three Arduino libraries providing “soft” serial port support. It’s the direct descendant of ladyada’s AFSoftSerial, which introduced interrupt-driven receives – a dramatic improvement over the polling required by the native SoftwareSerial.

Without interrupts, your program’s design is considerably restricted, as it must continually poll the serial port at very short, regular intervals. This makes it nearly impossible, for example, to use SoftwareSerial to receive GPS data and parse it into a usable form. Your program is too busy trying to keep up with NMEA characters as they arrive to actually spend time assembling them into something meaningful. This is where AFSoftSerial’s (and NewSoftSerial‘s) interrupt architecture is a godsend. Using interrupt-driven RX, your program fills its buffer behind the scenes while processing previously received data.

Improvements

NewSoftSerial offers a number of improvements over SoftwareSerial:

  1. It inherits from built-in class Print, eliminating some 4-600 bytes of duplicate code
  2. It implements circular buffering scheme to make RX processing more efficient
  3. It extends support to all Arduino pins 0-19 (0-21 on Arduino Mini), not just 0-13
  4. It supports multiple simultaneous soft serial devices.*
  5. It supports a much wider range of baud rates.**
  6. It provides a boolean overflow() method to detect buffer overflow.
  7. Higher baud rates have been tuned for better accuracy.
  8. It supports the ATMega328 and 168.
  9. It supports 8MHz processors.
  10. It uses direct port I/O for faster and more precise operation.
  11. (New with version 10).  It supports software signal inversion.
  12. (New) It supports 20MHz processors.
  13. (New) It runs on the Teensy and Teensy++.
  14. (New) It supports an end() method as a complement to begin().

*But see below for an important caveat on multiple instances.
**Be circumspect about using 300 and 1200 baud though. The interrupt handler at these rate becomes so lengthy that timer tick interrupts can be starved, causing millis() to stop working during receives.

Using Multiple Instances

There has been considerable support for an library that would allow multiple soft serial devices. However, handling asynchronously received data from two, three, or four or more serial devices turns out to be an extremely difficult, if not intractable problem. Imagine four serial devices connected to an Arduino, each transmitting at 38,400 baud. As bits arrive, Arduino’s poor little processor must sample and process each of 4 incoming bits within 26 microseconds or else lose them forever. Yikes!

It occurred to me, though, that multiple instances could still be possible if the library user were willing to make a small concession. NewSoftSerial is written on the principle that you can have as many devices connected as resource constraints allow, as long as you only use one of them at a time. If you can organize your program code around this constraint, then NewSoftSerial may work for you.

What does this mean, exactly? Well, you have to use your serial devices serially, like this:

#include <NewSoftSerial.h>

// Here's a GPS device connect to pins 3 and 4
NewSoftSerial gps(4,3);

// A serial thermometer connected to 5 and 6
NewSoftSerial therm(6,5);

// An LCD connected to 7 and 8
NewSoftSerial LCD(8,7); // serial LCD

void loop()
{
  ...
  // collect data from the GPS unit for a few seconds
  gps.listen();
  read_gps_data();  // use gps as active device
  // collect temperature data from thermometer
  therm.listen();
  read_thermometer_data(); // now use therm
  // LCD becomes the active device here
  LCD.listen();
  LCD.print("Data gathered...");
  ...
}

In this example, we assume that read_gps_data() uses the gps object and read_thermometer_data() uses the therm object. Any time you call the listen() method, it becomes the “active” object, and the previously active object is deactivated and its RX buffer discarded. An important point here is that object.available() always returns 0 unless object is already active. This means that you can’t write code like this:

void loop()
{
  device1.listen();
  if (device1.available() > 0)
  {
    int c = device1.read();
    ...
  }
  device2.listen();
  if (device2.available() > 0)
  {
    int c = device2.read();
    ...
  }
}

This code will never do anything but activate one device after the other.

Signal Inversion

“Normal” TTL serial signaling defines a start bit as a transition from “high” to “low” logic.  Logical 1 is “high”, 0 is “low”.  But some serial devices turn this logic upside down, using what we call “inverted signaling”.  As of version 10, NewSoftSerial supports these devices natively with a third parameter in the constructor.

NewSoftSerial myInvertedConn(7, 5, true); // this device uses inverted signaling
NewSoftSerial myGPS(3, 2); // this one doesn't

Library Version

You can retrieve the version of the NewSoftSerial library by calling the static member library_version().

int ver = NewSoftSerial::library_version();

Resource Consumption

Linking the NewSoftSerial library to your application adds approximately 2000 bytes to its size.

Download

The latest version of NewSoftSerial is available here: NewSoftSerial12.zip.  Note: don’t download this if you have Arduino 1.0 or later.  As of 1.0, NewSoftSerial is included in the Arduino core (named SoftwareSerial).

Change Log

  1. initial version
  2. ported to Arduino 0013, included example sketch in package
  3. several important improvements: (a) support for 300, 1200, 14400, and 28800 baud (see caveats), (b) added bool overflow() method to test whether an RX buffer overflow has occurred, and (c) tuned RX and TX for greater accuracy at high baud rates 38.4K, 57.6K, and 115.2K.
  4. minor bug fixes — add .o file and objdump.txt to zip file for diagnostics.
  5. etracer’s inline assembler fix to OSX avr-gcc 4.3.0 interrupt handler bug added.
  6. ladyada’s new example sketch, fix to interrupt name, support for 328p.
  7. etracer’s workaround is now conditionally compiled only when avr-gcc’s version is less than 4.3.2.
  8. 8 MHz support and flush() and enable_timer0()  methods added
  9. digitalread/write scrapped in favor of direct port I/O.  Revised routines now get perfect RX up to 57.6K on 16MHz processors and 31.25K on 8MHz processors.
  10. inverted TTL signalling supported.  20MHz processors supported.  Teensy and Teensy++ supported.  New end() method and destructor added to clean up.
  11. added listen() method to explicitly activate ports.
  12. warn users about 1.0 conflict

Acknowledgements

Many thanks to David Mellis, who wrote the original SoftwareSerial, and to the multi-talented ladyada, whose work with AFSoftSerial is seminal.  Ladyada also provided the “Goodnight, moon” example sketch, fixed a problem with the interrupt naming (see v6) and tested NSS with the 328p.

Thanks also to rogermm and several other forum users who have tested NewSoftSerial and given useful feedback.

The diligent analysis of forum user etracer yielded the root cause of a tricky problem with NSS on OSX.  A bug in avr-gcc 4.3.0 causes the compiler to fail to generate the proper entry and exit sequences for certain interrupt handlers.  etracer identified the problem and provided an inline workaround.  etracer’s fix is in NSS 5.

User jin contributed a large body of work based on NSS and identified a potential problem that could result in data loss (fixed in NSS 5).  jin also made a variant of NSS that supports 4-pin serial, with the additional pins providing a very nice RTS/CTS flow control.  We may see this in NSS in the near future.

Thanks to Garret Mace, who contributed the delay tables for 20MHz processors and claims that he can send and receive at 115K baud.  Cool!

Thanks to Paul Stoffregen, both for his fine work with Teensy and Teensy++, and for contributing some useful suggestions that help NewSoftSerial run on them without modification.

I appreciate any and all input.

Mikal Hart

Page last updated on July 3, 2013 at 7:37 pm
646 Responses → “NewSoftSerial”

  1. Creative

    13 years ago

    Hi,

    I’ve found some ¿bugs? on newsoftserial library:

    On line 76, change this “{ 115200, 1, 17, 17, 12, },” for this “{ 115200, 1, 16, 16, 12, },”

    On line 94, change this “static const DELAY_TABLE table[] PROGMEM=” for this “static const DELAY_TABLE PROGMEM table[]=”

    Any possibility to use non-standard baudrates?

    Thanks for this great work


  2. Mikal

    13 years ago

    Hey, thanks, Creative. About the specific values of the table, it’s very hard at high baud rates to say which ones are “correct”. Minute variations in the clocks can mean that while 17 is a good choice for me, 16 is better for other people.

    And about the placement of the PROGMEM keyword, I am under the impression that either placement results in the same code. Do you have evidence to the contrary?

    Thanks,

    Mikal


  3. Collin

    13 years ago

    Hello Mikal,

    Your library looks great!

    I`m using a Sanguino (Atmega644p) and when i compile i get the following error:

    E:\arduino-0021\arduino-0021\libraries\NewSoftSerial\NewSoftSerial.cpp: In member function ‘void NewSoftSerial::begin(long int)’:
    E:\arduino-0021\arduino-0021\libraries\NewSoftSerial\NewSoftSerial.cpp:410: error: ‘NULL’ was not declared in this scope
    E:\arduino-0021\arduino-0021\libraries\NewSoftSerial\NewSoftSerial.cpp: In member function ‘void NewSoftSerial::end()’:
    E:\arduino-0021\arduino-0021\libraries\NewSoftSerial\NewSoftSerial.cpp:428: error: ‘NULL’ was not declared in this scope

    When i compile it for an arduino is works fine.

    What do i need to change, to make it work for the 644?

    Thanks!

    ,Collin


  4. Mikal

    13 years ago

    Collin, yeah, NewSoftSerial doesn’t (yet) support the 644p. If the 644p supports pin change interrupts you could extend the #if block at the top of NewSoftSerial.h to support it. Go for it! :)

    M


  5. Anders

    13 years ago

    Wouldn’t it be better to have NewSoftSerial inherit from Stream instead of Print? That way code could be written to use either Serial or NewSoftSerial by just having a reference to a Stream class.


  6. Mikal

    13 years ago

    @Anders,

    You could certainly argue that, but many people don’t want the overhead of Stream in their project. And if you wanted a reference to a class that could be either Serial or NewSoftSerial, well, just make it a Print &.

    Mikal


  7. Jarvis

    13 years ago

    Are you actively working on the RTS/CTS solution? I’m working on a project, and am about to try implementing the RTS/CTS, but I’ll be doing it as a “hack” job I’m sure. So I just wanted to see if there’s something I can either help with, or if you’re close I would love to help test. I literally have till Monday night to get my solution working.

    Thanks,
    Jarvis


  8. Anders

    13 years ago

    @Mikal
    The overhead of the Stream class is negligible since it’s virtual. I changed the NewSoftSerial to inherit from Stream (about four lines of code difference) and testing with the NewSoftSerialTest example project the code gets 46 bytes bigger (4920 to 4966 bytes). Same result with the TwoNSSTest project.

    The problem with using the Print class is that it’s one-directional. If we want to be able to read() the Stream class is needed, and NewSoftSerial already implements the methods needed (just change available() to return an int).

    Anyways, thanks for your awesome contribution to the Arduino community! This class should be included with the IDE.


  9. kerbero

    13 years ago

    I´m trying to sync an Arduino FIO with XBee with the coordinator of my network. The code works as follows:

    1. A coordinator sends to arduino FIO its UNIX time.
    2. Arduino FIO receives the UNIX time of the server, process it and set the system time with setTime();

    The time is set correctly but the system allways reports the same time (calling to hour(), minute() and second() ). I am using newsoftwareserial to debug the information.

    example:

    11:17:58 2 12 2010
    11:17:58 2 12 2010
    11:17:58 2 12 2010
    11:17:58 2 12 2010
    11:17:58 2 12 2010



    11:17:58 2 12 2010

    It is possible that newSoftwareSerial disables the interrupts that works with the system time???


  10. Mikal

    13 years ago

    @kerbero,

    NewSoftSerial does indeed disable the interrupts that run the millis() counter, but only for very short durations. The practical effect is that occasionally a timer interrupt might be occasionally delayed, but not enough to affect the system time.

    EXCEPT that at very slow baud rates (300 or 1200 on a 16MHz processor) the bytes get so long that a second or third timer tick interrupt might arrive before an earlier one gets processed. This causes interrupt starvation and the result is that the system millis() clock appears to slow down. But I wouldn’t expect it to stop completely.

    What happens when you print the value of millis() instead of the system time? What baud rate are you running at? Is there anything else going on in the system?

    Mikal


  11. RobotGrrl

    13 years ago

    Has anyone had any troubles trying to go from NSS->NSS? It never seems to work for me, but if it is:
    UART->NSS
    or
    NSS->UART
    it works fine. Is it because the Arduino boards that I am using are of different sizes? Or speed?

    Just wondering! :)


  12. dullard

    13 years ago

    Mikal,

    Thanks for putting out useful tools such as NewSoftSerial.

    I know that you have the MEGA in the “upcoming improvements” section. How is that coming? I have a use for the MEGA that I can’t seem to get to communicate with equipment such as the Touchshield Slide. The best that I can figure out is to use NewSoftSerial to transmit data from the MEGA to the Touchshield, but I can’t seem to get data to be received from the Touchshield. If you want, see more comments here: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1291762907


  13. Mikal

    13 years ago

    @dullard,

    I sent a beta copy of the new version to your email. Try it out!

    Mikal


  14. liudr

    13 years ago

    Mikal,

    Thanks a lot for writing this library. I am using it with your TinyGPS library on one project. It’s great to have it up and running in minimal time on my side:) I love all your reverse geocache stories too. I’ve told it to a bunch of people already.

    Here is a request for you: can you add an event handler on the newSoftSerial library so that when the buffer is full, an event handler is called.
    Like: nss.attach(&feedGPS);

    The reason to my request is that if I am running a GPS routine with other stuff, I have to feed the GPS constantly, making programming more difficult and less efficient. If I attach that feedGPS to the event handler of the newSoftSerial, then it automatically feeds the GPS so the GPS will be up to date if I read it any time. I can just call gps.getXXX() any time I need GPS information. Other times I can have arduino run an LCD and gather uer input and display proper information, not all of which are GPS-related.

    Liudr


  15. Kamilion

    13 years ago

    I’d like to have a look at that Mega beta as well. I’ve got a 2560, three fast serial devices, and two slow serial devices that I need to talk to.
    Love TinyGPS, gets along great with my Venus at 115.2K and 8Hz update rate.


  16. blalor

    13 years ago

    Hey, Mikal. I started to make some changes to your code in my GitHub project. I noticed that you started a GH project for NSS a couple of months ago, but haven’t added the code yet. I was hoping to create a fork, but couldn’t wait any longer. :-)

    I’ve implemented a few changes you might be interested in, including inheriting from Stream and adding peek(), peek(offset), and remove(offset) methods. The relevant commit is here: https://github.com/blalor/NewSoftSerial/commit/daab2811182b808d73d27e27ce7006d4c9ce14a6

    I’d appreciate your feedback!

    Thanks,
    Brian


  17. Mikal

    13 years ago

    liudr,

    This is a good suggestion and one that I have considered in the past. However, because NSS may be soon migrating to Arduino, I am a little reluctant to introduce new functionality at this point.

    Mikal


  18. Coofer Cat

    13 years ago

    Hi Mikal,

    Firstly, thank you for an excellent library, and article describing it.

    I’d like to ask if there’s a way I can ‘piggy back’ on the interrupts you use, or else use a separate interrupt. The reason I ask is that I’d like to add some simple networking to this (as a separate library). The idea being that you can send a message something like this:

    [dest][length][message][checksum]

    Obviously, to receive that string of characters requires a bit of careful state work, but it means you can send short messages reliably between devices (sort of like VirtualWire does). My plan is to have an interrupt constantly check the NewSoftSerial available() method, and then attempt to receive messages (into an RX buffer). The main loop() can then be checking networking.available() to see if actual messages were received.

    So… the thing is another layer of interrupt handling (for receiving). I could either use the same interrupt (so long as I write very efficient code), or else use another (lower priority?) interrupt. What do you think my chances are? ;-)


  19. Mikal

    13 years ago

    Coofer,

    I think in your case I would modify NewSoftSerial::recv() to call an external function in your main code body every time a character was received. Something like this:

    if ((_receive_buffer_tail + 1) % _SS_MAX_RX_BUFF != _receive_buffer_head)
    {
      // save new data in buffer: tail points to where byte goes
      _receive_buffer[_receive_buffer_tail] = d; // save new byte
      _receive_buffer_tail = (_receive_buffer_tail + 1) % _SS_MAX_RX_BUFF;
      extern void myfunc(); // This is something defined in your code
      myfunc(); // where you would retrieve the new character
    }
    

    Remember that myfunc() will be called in interrupt context, so make sure whatever happens there is quick!

    Mikal


  20. Mo

    13 years ago

    Hey,

    Thanks a lot for this library; I was starting to lose hope of being able to read my RFID reader with arduino! However, I am still having some problems…

    The RFID reader runs at 57600 baud rate, and my only issue with using the UART is the reader uses inverted logic, and there were some bytes that are missed. I am not sure why it does that… perhaps because of all the processing I have to do to invert it again; would that cause it to lose bytes? In any case, when I use the NSS, it reads all 38 bytes… nearly fine. It isn’t perfectly accurate. I get an extra “1″ every now and then. So for a 4-byte number that I am expecting to be 993101, the first byte is supposed to be a 0, but it is instead sometimes 128, which makes the whole number become negative. I’m not sure if that’s the only issue; I haven’t dissected the results too fully yet.

    There’s another inaccuracy that is more persistent… When expecting a 42, I instead get 170, which is simply an extra 1.
    42=0010 1010, 170=1010 1010.

    Do you have any suggestions for tweaking the library a little bit to get it more accurate?

    I’m using arduino-0022 software, NSS 10 library(the one posted here at the time of writing this) on an arduino Uno (16MHz)

    Thanks,
    Mo


  21. Mikal

    13 years ago

    Mo,

    Timing is a dicey thing and can actually vary from board to board, especially at high speeds. 57600 is certainly a tricky one. The best I can recommend is that you play with the timing table for 16MHz.

      { 57600,    10,        37,        37,       33,    }, 

    Try changing the first 37 to, say, 36.

    If you are missing bytes (and you can prove this by checking overflow()), then you probably are doing too much processing in the background.

    Mikal


  22. SysRun

    13 years ago

    Hi,

    it is possible to catch and generate UART-Break-Conditions? (http://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter#Break_condition)

    There are some Systems (like my Heating-System) which marks a end of a data-telegram with this Breaks.

    Regards,
    Fred


  23. Mikal

    13 years ago

    Sorry SysRun, NewSoftSerial is not configured to detect Breaks, and doesn’t have any mechanism for reporting such events back to the caller program.

    Mikal


  24. Mark

    13 years ago

    Mikal,
    You are the man. I am brand new to Arduino but I had your NewSoftSerial and TinyGPS (with Sparkfun breakout for Venus634LPx) up and running in no time. Excellent!


  25. tom

    13 years ago

    hi, thanks for NSS…
    i need some help. i have seeeduino (atmega168 @ 16Mhz) soft Arduino 0022 NSS 10c version. with NSS RX is all ok but with TX is somthing wrong…
    simple test:
    ////////////////////////////////
    #include

    NewSoftSerial mySerial(3, 4);

    void setup()
    {
    mySerial.begin(9600);
    }

    void loop()
    {
    mySerial.print(‘a’);
    delay(1000);
    }
    ////////////////////////////////

    and from debuging terminal i got ONLY FIRST char ok. terminal show bits (01100001 11000010 11000010 11000010……) after reset board the same (01100001 11000010 11000010 11000010……). if i change char ‘a’ to ‘z’ i got (01111010 11110100 11110100……). all bits are shifted by one bit. can someone help me? thanks


  26. Chris

    13 years ago

    @Mikal,

    I am working on the same issure with getting the touchshield slide to transmit to the the Arduino Mega on pins 2,3 which are interupts 4,5 on the mega and not the 0,1 of the 328.

    Can you send me a copy also.

    Thanks,
    Chris

    @dullard,

    I sent a beta copy of the new version to your email. Try it out!

    Mikal


  27. Rainer

    13 years ago

    Hej Mikal,

    this library looks like a very nice piece of software! Do you think it’s possible to use it for very low bitrates (50 baud or less) as well? And how would I calculate the timing values (DELAY_TABLE table[]) then?

    I’d like to use it for data transmission from a high altitude amateur balloon down to earth and that requires such a slow bitrate.

    Thanks in advance and regards, Rainer


  28. Mikal

    13 years ago

    @Rainer–

    I think you could get NewSoftSerial to work at 50 baud by simply adding a new row to table. To calculate the values, just multiply the values for 300 baud by 6. (This is not an exact way to do it but for these large values the error should be negligible.)

    One thing to note though, is that at such speeds the millis() timer won’t work properly because you’re turning off interrupts for such long durations.

    Mikal


  29. pedro

    13 years ago

    Hello there! how i can use this library to comunicate with my Bluetooth Bee conected to shield and to arduino? i need to configure it, so i need a code that send what i send to arduino to xbee shield and what the bluetooth answer send me back, sorry for my english!

    i got this:

    Xbee Shield
    http://www.seeedstudio.com/depot/xbee%C3%82%C2%AE-shield-v11-by-seeedstudio-p-419.html

    Bluetooth Bee
    http://www.seeedstudio.com/depot/bluetooth-bee-p-598.html

    Arduino Uno
    http://arduino.cc/en/Main/ArduinoBoardUno

    Thanks a lot for the library!


  30. rin

    13 years ago

    Hi,

    I have fiddled with the delay constants and found that, in my particular environment (Duemilanove, 16MHz, IDE 0022), they need be corrected as follows to work.

    { 14400, 76, 160, 160, 157, },
    { 9600, 117, 242, 242, 239, },
    { 4800, 243, 494, 494, 491, },
    { 2400, 494, 996, 996, 993, },
    { 1200, 995, 1998, 1998, 1995, },
    { 300, 4004, 8017, 8017, 8014, },

    For 19200bps and up, they work as is.

    Thanks,
    rin


  31. Mikal

    13 years ago

    That’s most interesting. I rather expect that high baud rates might experience some sensitivity on different crystals, but it’s really surprising that your low baud rates, which are usually quite tolerant, vary. Thanks for the contribution.

    Mikal


  32. rin

    13 years ago

    @Mikal,

    Yes, I expected the contrary but that’s what I saw. The range of tolerance was small even with lower speeds (300 or 1200), such as within 5 or 6 ‘rx intrabits’. Perhaps in lower speeds, the number of multiplication is bigger so the time difference is bigger, whereas in higher speeds smaller multiplication makes more constant time of delay?

    These values are stable over several different Duemilanove clones (different crystals, some even with Ceralock) which I’ve tested, so it’s not the crystal. They are all with FTDI chips.

    Anyway, thanks for this great work.

    rin, Tokyo


  33. Mao

    13 years ago

    Hi,

    Thanks a lot for this great library.
    I try to communicate with a device which only accept:
    8 bits of data
    1 bit of even parity
    2 stop bits
    Is there a way to configure your library to handle this?


  34. Mikal

    13 years ago

    Sorry Mao. I’m afraid there isn’t any support for such configurations.

    Mikal


  35. Ross

    13 years ago

    Hello Mikal,

    A newbie here. You say “It extends support to all Arduino pins 0-19″. I recognise 0-13 on the Duemilanove. Do the A0-A5 pins correspond to the 14-19?

    Thanks for your great library resource.

    Cheers,

    Ross


  36. Mikal

    13 years ago

    Ross, you’re quite right. It’s not very well documented, but each of the “analog” pins can double as a “digital” pin. A0-A5 = 14-19.

    Mikal


  37. Allen

    13 years ago

    @Mikal

    Is there a way I can look at each char coming on interrupt and trigger a function based on that char? It has been a while since I’ve coded in C and I am very rusty on the code for the arduino. I’m actually just looking for the CR on this one as it is a request from another computer for data. Running 2400. Thought about just using the interrupt on 2 but it would drop LOW multiple times during the request and I don’t want to push data out every time that happens.


  38. henieck

    13 years ago

    A tried to use this library to read from mobile phone – It works OK only for short phone serial buffers – but when I try to get longer SMS message form the phone (using AT commands) – I can only read 63 bytes out of 90 in my example. After sending appropriate AT command – the response form the phone should be 90 bytes long – but function “available” shows only 63 bytes – and there is so many bytes waiting in the phone buffer indeed. Looks like the rest of the chain is cut off. I don’t know – if I do something wrong – but there is no problem reading the whole message form the phone when I use typical Serial function in place of NewSoftSerial. Also there is no problem reading when I use Hyperterminal.


  39. Mikal

    13 years ago

    Allen, there is no built-in way to do that, but if you modify the recv() function you could have it call an external function in your sketch like this:

    if ((_receive_buffer_tail + 1) % _NewSS_MAX_RX_BUFF != _receive_buffer_head)
    {
    // save new data in buffer: tail points to where byte goes
    _receive_buffer[_receive_buffer_tail] = d; // save new byte
    _receive_buffer_tail = (_receive_buffer_tail + 1) % _NewSS_MAX_RX_BUFF;
    extern void foo(uint8_t c);
    foo(d);
    }

    Mikal


  40. Mikal

    13 years ago

    @henieck–

    There is a 64-byte buffer in NewSoftSerial. You are using the following strategy, which won’t work:

    1. Send AT command
    2. Wait for available() to show that 90 characters have been received.
    3. Read the characters

    This won’t work because available will never return a value greater than 63. Try this strategy instead:

    1. Send AT command
    2. Keep reading characters as they arrive until you have read the entire message.

    For example, if you expect exactly 90 characters, you might do this:

    char buf[90];
    for (int i=0; i<90; )
    if (nss.available())
    buf[i++] = nss.read();

    Mikal


  41. LU

    13 years ago

    HI,
    does newsoftserial support arduinoBT?


  42. Mikal

    13 years ago

    @LU, I’ve never tried an arduinoBT, but I feel pretty sure that it is similar enough to an ordinary Uno to guess that NewSoftSerial should work fine.

    Mikal


  43. uyeop

    13 years ago

    hi, im a newbie here.. does your library support mega 1280? i wanted to use the software serial on duemilanove but right now i only have mega. So, can i just try the software serial on mega first?


  44. Mikal

    13 years ago

    The very newest NewSoftSerial is in beta (http://arduiniana.org/2011/01/newsoftserial-11-beta/). It has support for the Mega. Read the post about which pins are supported for RX.

    Mikal


  45. RD

    13 years ago

    I have newsoftserial running on a atmega644p. below the macros needed to set the interupt structure to match the pinout listed for the Sanguino.

    Have only tested on a few pins on portC. If any one else has a Sanguino, would you verify. When i get a board setup, i will finish verifying the rest of the pins. This should work on the 1284 as well, since the interupts are the same.

    This is running in Arduino v22.

    #if defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__)

    #define digitalPinToPCICR(p) (((p) >= 0 && (p) <= 21) ? (&PCICR) : ((uint8_t *)0))
    #define digitalPinToPCICRbit(p) (((p) <= 7) ? 2 : (((p) <= 13) ? 0 : 1))
    #define digitalPinToPCMSK(p) (((p) <= 7) ? (&PCMSK2) : (((p) <= 13) ? (&PCMSK0) : (((p) <= 21) ? (&PCMSK1) : ((uint8_t *)0))))
    #define digitalPinToPCMSKbit(p) (((p) <= 7) ? (p) : (((p) = 0 && (p) <= 31) ? (&PCICR) : ((uint8_t *)0))
    #define digitalPinToPCICRbit(p) (((p) <= 7) ? 1 : (((p) <= 15) ? 3 : (((p) <= 23) ? 2 : 0)))
    #define digitalPinToPCMSK(p) (((p) <= 7) ? (&PCMSK1) : (((p) <= 15) ? (&PCMSK3) : (((p) <= 23) ? (&PCMSK2) : (((p) <= 31) ? (&PCMSK0) : ((uint8_t *)0)))))
    #define digitalPinToPCMSKbit(p) (((p) <= 7) ? (p) : (((p) <= 15) ? ((p) – 8) : (((p) = 10) && ((p) = 50) && ((p) = 62) && ((p) = 10) && ((p) = 50) && ((p) = 62) && ((p) = 10) && ((p) = 50) && ((p) = 62) && ((p) = 10) && ((p) = 62) && ((p) <= 69)) ? ((p) – 62) : \
    0 ) ) ) ) ) )


  46. RK

    13 years ago

    What I am doing wrong?
    I have this code witch was working on the old library, but with newsoftwaresserial is not working.
    I am trying to communicate with a GPS from Libelium.
    Who can help me and tell me where is my mistake.


    SoftwareSerial SerGPS(9,8);

    //Create a ‘fake’ serial port. Pin 8 is the Rx pin, pin 9 is the Tx pin.
    SerGPS.begin(9600);
    while(byteGPS != 42)
    { // read the GGA sentence
    if (SerGPS.available());
    byteGPS = SerGPS.read();
    inBuffer[i++]== byteGPS;
    }


  47. captnkrunch

    13 years ago

    Yes, newsoftserial disables millis timer significantly at lower baud rates. My experience in processing a continuous data stream at 2400 baud shows that millis reports 44,000 milliseconds per minute.


  48. Mikal

    13 years ago

    @RK–
    Change that to

    while(byteGPS != 42)
    { // read the GGA sentence
      if (SerGPS.available())
      {
        byteGPS = SerGPS.read();
        inBuffer[i++]== byteGPS;
      }
    }

  49. Mikal

    13 years ago

    @Capn,

    Yup, but only at 2400 and lower.

    Mikal


  50. Wagner Sartori Junior

    13 years ago

    Sanguino, atmega644 and atmega644p support available on http://code.google.com/p/sanguino/issues/detail?id=15

    I’ll be glad if you add it to your current code.

93 Trackbacks For This Post
  1. NewSoftSerial 5 « Arduino

    [...] NewSoftSerial version 5 is available. A lot of people have been using this library — thanks! — but I really need to recognize the exceptional work of two contributors. [...]

  2. NewSoftSerial 6 « Arduiniana

    [...] I posted the new library. [...]

  3. เริ่มต้นสร้าง GPS จอสีกับอาดูอี้โน่ | Ayarafun Factory

    [...] ในรอบนี้ผมได้ใช้ newSoftwareSerial3 จะได้ลองด้วยว่า มีปัญหาไหม

  4. Unlogic » USB Storage and Arduino

    [...] of the first things to do is download NewSoftSerial

  5. The Hired Gun » GPS project: the Bluetooth saga

    [...] to the task at hand, which happened to be adding 3 lines of code: declaration of an instance of NewSoftSerial, calling the instance constructor with a baud rate, and a single call to pass the char from the [...]

  6. layer8 » Controlling A Roomba with an Arduino

    [...] and the XBee module has a serial interface.  So how does this really solve my problem?  Enter NewSoftSerial, an updated version of the Arduino software serial library, which basically lets you drive a serial [...]

  7. This and That » Blog Archive » Arduiniana - What else would it be?

    [...] is probably the coolest gift idea I’ve seen.  Mikal, you rock.  And also, thank you for NewSoftSerial.  [...]

  8. Interfacing the Arduino with the DS1616

    [...] way.  Let’s move onto the software.  Communication with the DS1616 is established using the NewSoftSerial library.  Getting data is essentially a case of lots of bit banging.  The DS1616 library [...]

  9. Serial Multiplexing « Interactive Environments Minor 2009-2010

    [...] So we started looking for a solution to overcome this tiny inconvenience. First we looked into a software serial but this didn’t work out, it was a bit too much for the arduino’s little processor to [...]

  10. Atmega/Arduino (Soft-) Serial Ports | Jochen Toppe's Blog

    [...] software serial port. I briefly thought about writing one, but then I found this great libary, the New SoftSerial. It is as simple to use as the original library, but unfortunately once I connect the RF receiver, [...]

  11. The Frustromantic Box, Part 4: Software « New Bright Idea

    [...] developers for the great libraries, and to Mikal Hart in particular for his work on the TinyGPS and NewSoftSerial [...]

  12. side2 » Bimeji Client for Arduino

    [...] このソースでは、PS2ライブラリとNewSoftSerialライブラリを利用しています。 コンパイルするには、これらのライブラリを有効にしておく必要があります。 [...]

  13. Live Twitter Table using New Bluetooth Shield | Club45

    [...] as a well. The shield can be wired to any of the pins on the Arduino. Right now we’re using NewSoftSerial on pins 4 and 5. It can be attached to the hardware RX and TX pins, but interferes with [...]

  14. tokyo->kobe->osaka << Motoi Ishibashi

    [...] 急遽、Arduinoでシリアル通信をふたつやる必要が発生してホテルで開発。といっても手元にハードがないので、ほとんど勘でプログラムしているようなもの。 次の日現場で試すも、予想通り動かない。そりゃそうだ。 NewSoftwareSerialなんていう便利なものがあるのを後で知った。 [...]

  15. VDIP1 USB Host Controller « Arduino Fun

    [...] chose the NewSoftSerial library to give access to the VDIP1.  The first attempt was to use the AFSoftLibrary and it just [...]

  16. Project Lab

    [...] software running on the Arduino ATMEGA328 chip utilizes the wonderfully robust NewSoftSerial library for communicating with the EM-406a GPS module and the very convenient TinyGPS library for [...]

  17. Box Round 2 « Stromberg Labs

    [...] is available here. I borrowed from a couple of people’s Arduino libraries to get this done, notably NewSoftSerial from Arduiniana and the GPS Parsing code from the Arduino website for parsing the NMEA strings. [...]

  18. Grok Think » Blog Archive » I got Arduino sending temp to the computer using xbee wireless.

    [...] I had to use this library to communicate with the xbee from the arduino:  http://arduiniana.org/libraries/newsoftserial/ [...]

  19. GPS – Welcher Chip? | Ranzow im Umbau

    [...] wird über die Serielle Schnittstelle angesteuert. Die werde ich wahrscheinlich über die NewSoftSerial Library [...]

  20. GPS – Welcher Chip? | Ranzow im Umbau

    [...] GPS Modul wird über die Serielle Schnittstelle angesteuert. Die werde ich wahrscheinlich über die NewSoftSerial Library [...]

  21. Cititor RFID 125KHz « Tehnorama

    [...] metoda de a afla codul cartelei este de a utiliza biblioteca NewSoftSerial, disponibila gratuit aici. Fisierul zip se dezarhiveaza si se copiaza in folderul libraries al distributiei [...]

  22. Lightweight software UART -> custom serial « Robotics / Electronics / Physical Computing

    [...] updated the NewSoftSerial library from Arduiniana (thanks Mikal !) so that it takes 2 extra [...]

  23. Control Camera with Arduino | SenSorApp

    [...] http://arduiniana.org/libraries/newsoftserial/ [...]

  24. GPS testing with LCD Character Display

    [...] the TinyGPS library from Arduiniana downloaded and installed for it to work. They suggest using NewSoftSerial, but I couldn’t get that to work, so I scrapped that portion. Here’s my [...]

  25. #Rallylog Fusebits

    [...] it as a fail and moved on, however last night when I set about writing the RFID read function using NewSoftSerial on the RFID I was getting nothing reported back back on the AVR, not a thing coming back from the [...]

  26. 433 MHz receiver and NewSoftSerial at mitat.tuu.fi

    [...] http://arduiniana.org/libraries/newsoftserial/ http://www.sparkfun.com/commerce/product_info.php?products_id=8950 [...]

  27. Moving Forward with Arduino – Chapter 17 – GPS « t r o n i x s t u f f

    [...] devices. At this point you will need to install two libraries into the Arduino software – NewSoftSerial and TinyGPS. Extract the folders into the libraries folder within your arduino-001x [...]

  28. Moving Forward with Arduino – Chapter 17 – GPS « Hey it’s my blog…

    [...] this point you will need to install two libraries into the Arduino software – NewSoftSerial and TinyGPS. Extract the folders into the librariesfolder within [...]

  29. Sonar | Starter Kit

    [...] there is one more library – “NewSoftSerial”, which is free of these defects and, in addidion, handles inverted serial [...]

  30. Advanced RFID with Arduino and Python! | App Delegate Inc

    [...] NewSoftSerial [...]

  31. RFID Door Opener – Update 3 – LCD Woes - Sommineer

    [...] one on some other pins.  Per the suggestion of some people on the Arduino forums, I decided to use NewSoftSerial to do the communication.  Being interrupt driven, it was much more efficient than the older [...]

  32. keyHelper final project

    [...] the code you will need a very useful NewSoftSerial library, that, among other things, allows you to assign TX and RX on other pins then 0 and 1 and that way [...]

  33. Step-by-Step Guide on using the Bluetooth Bee, Bees Shield & Arduino to communicate via bluetooth | Michael Chuah

    [...] up would be to try and use the awesome NewSoftSerial library by Mikal Hart to communicate with the Bluetooth Bee by emulating the UART [...]

  34. Tutorial: Arduino and GSM Cellular – Part One « t r o n i x s t u f f

    [...] a software perspective we will need the NewSoftSerial Arduino library, so please download and install that before moving [...]

  35. Interfacing Arduino to GSM shield | Embedded projects from around the web

    [...] goes step by step how to connect Cellular shield to Arduino mega and communicate to it by using newsoftserial Arduino library. Whole process steps are monitored in terminal window, so it is easy to follow [...]

  36. Fully functional Arduino GPS logger « Liudr's Blog

    [...] NewSoftSerial library [...]

  37. LCD117 Controller Library - Jack Kern

    [...] also need the NewSoftSerial library installed in your Arduino sketchbook’s library [...]

  38. Touch game for the offspring | NinjaTool inc.

    [...] GLCD that I bought (without knowing ANYTHING about it beforehand I might add). The code uses the NewSoftSerial library which apparently does wonders, but as of yet has not been validated as the code assumes a 9V [...]

  39. Arduino GSM and GPRS shield | Open Electronics

    [...] the pin 4 and 5 there aren’t problems to upload the sketch but the maximum baudrate for NewSoftSerial (the serial library) is 57600. We performed a GSM library to controll easly the module. The GSM [...]

  40. Moving Forward with Arduino – Chapter 19 – GPS part II « t r o n i x s t u f f

    [...] forget the 10k ohm pull-down resistor). You will need to install the SdFAT library, NewSoftSerial library, TinyGPS library and the SdFat library if not already [...]

  41. Blog What I Made » YAHMS: Base Station

    [...] of just the standard Serial interface, see the links below for that too. You’ll also need NewSoftSerial of course and the Flash library which I’ve used to decrease memory usage. Follow the [...]

  42. Infovore » Nikon D-Series Intervalometer

    [...] a single wire, which again, keeps the number of wires from the Arduino down. I’m using the NewSoftSerial library to talk to it, which makes life [...]

  43. Arduino Experiments

    [...] you can use multiple serial “ports”, that are actually digital I/O lines, by using the NewSoftSerial library. This works exactly like the Serial library, but you can read from multiple pins, as long as you [...]

  44. EasyTransfer Arduino Library « The Mind of Bill Porter

    [...] it’s easier to pick which Serial port to use; Serial, Serial1, etc. AND support for the NewSoftSerial library for creating software serial ports on any pin. Inside the download zip file are two versions of the [...]

  45. Research: RFID, XBee and Arduino « Beyond the keyboard

    [...] neat thing is the NewSoftSerial library for Adruino, allowing you to turn any set of pins into additional RX/TX pins with free to set baud [...]

  46. jomuoru weblog » Blog Archive » Esto es Camus Party

    [...] de instalar la librería NewSoftSerial pude compilar e instalar el Arduino Firmware en mi placa. A continuación necesitaba descargarme [...]

  47. Update: Design review « Appiphania

    [...] a bit of this code at the end of this journal entry. The “NewSoftSerial” library http://arduiniana.org/libraries/newsoftserial/ was extremely easy to get working (code example [...]

  48. Anonymous

    [...] Modul per Software-UART? Bitte einen Link oder Hinweis wo ich nachlesen kann. danke Schaust du hier __________________ FHZ1300 | 2x JeeLink | AVR-NETIO | FS20 | 1-Wire | 2x XBEE Pro | 4x XBEE 2.5 [...]

  49. Using A Second (Software) Serial USB To Debug Your Arduino | Utopia Mechanicus

    [...] actually really easy, using some code called NewSoftSerial (available from this site, at the ‘Download’ subheading). This software is much like your Serial device you use on the Arduino, but it’s in software [...]

  50. Kemper LED / Arduino Interface » Powerhouse Electronics

    [...] provided by the software library “NewSoftSerial”. The library can be downloaded from:: http://arduiniana.org/libraries/NewSoftSerial/. Since the communications port is created using software any of the Arduino port pins can be used. [...]

  51. Android talks to Arduino | ★ Elmindo Blog ★

    [...] NewSoftSerial library from Mikal Hart: http://arduiniana.org/libraries/newsoftserial/ [...]

  52. Utilizando a Bees Shield em uma Arduino Mega « A arte do hardware

    [...] via jumper na própria shield. Para comunicação com essa Bee, é necessário o uso da biblioteca NewSoftwareSerial, permitindo fazer que dois pinos digitais se tornem mais uma [...]

  53. Arduino camera and geotagger | jarv.org

    [...] NewSoftSerial lib was used for communicating over serial using an IO [...]

  54. Bluetooth + Arduino + Android – 1 : Transmettre des données d’un capteur branché sur une carte Arduino vers un Smartphone Android via bluetooth

    [...] 1– télécharger la bib­lio­thèque New­Soft­Se­r­ial pour Arduino NewSoftSerial10c.zip. Des expli­ca­tions et exem­ples plus détail­lés con­cer­nant cette bib­lio­thèque sur cette page (http://arduiniana.org/libraries/newsoftserial/). [...]

  55. Arduino + fon + OpenWRT + ser2net + NewSoftSerial « sea side she side

    [...] そのためソフトウェアシリアルを再現させたライブラリがありますのでそれを利用します。とはいっても標準ライブラリのSoftwareSerialは利用しません。高機能で速度もでるようになったNewSoftSerialを利用します。 [...]

  56. David C. Dean Arduino GPS – On the Cheap

    [...] NewSoftSerial Library - http://arduiniana.org/libraries/NewSoftSerial/ [...]

  57. Telemetry Using Xbee Modules | Anacortes RC Sailors

    [...] arduino remotely can be found here. For communication over XBee the Arduino appears to need the NewSoftSerial library. LD_AddCustomAttr("AdOpt", "1"); LD_AddCustomAttr("Origin", "other"); [...]

  58. NewSoftSerial, Attachinterupt() and Pins 2,3 | Anacortes RC Sailors

    [...] for attacheinterupt() are 2 and 3. The GPS shield uses digital 2 and 3 for GPS communication using NewSoftSerial. So I tried moving the GPS to other pins, 8 and 9 worked. Now pins 2 and 3 are free for my [...]

  59. Telemetry Using Xbee Modules | Anacortes RC Sailors

    [...] arduino remotely can be found here. For communication over XBee the Arduino appears to need the NewSoftSerial library. [...]

  60. [Arduino] Lecteur RFID à écran lcd, avec stockage du tag “valide” en EEPROM externe I2C « Skyduino – Le DIY à la française

    [...] Dans ce projet vous pouvez remarquer que je suis obligé d’utiliser deux port série, un à 9600 bauds pour l’écran lcd, et un autre à 2400 bauds pour le lectuer RFID. Normalement il me faudrait une mega (qui possède 3 port série) pour faire ce projet en hardware, mais il existe aussi des librairies Serial software ! C’est pourquoi je vais utiliser la librairie NewSoftSerial disponible ici : http://arduiniana.org/libraries/newsoftserial/ [...]

  61. An Idiot and an Arduino: Pretty WiFly for a White Guy « ~jmoskie

    [...] went through each error, and tried to resolve it myself. Some were easy. The "NewSoftSerial" libraries were incorporated into the core libraries, and they replaced the default SoftwareSerial [...]

  62. Arduino vs Arduino Mega – Which To Use? | Utopia Mechanicus

    [...] speed if you need a second or third (or fourth) port. On the Uno, you can do similarly using the NewSoftSerial library; however, software is slower, and if your program is pushing the limits, you may find a hardware [...]

  63. I can solder! 7-Segment Serial Display & Nunchucky operational « I Am Chris Nolan.ca

    [...] already.  I found this wall of text which I managed to digest down into this gist (and updated it thanks to these notes) which you can see running in the above [...]

  64. S2 » Android + Bluetooth + Arduino

    [...] そして、シリアル通信のテストに利用したArduinoのソースです。 NewSoftSerial(Arduinoライブラリ)を利用しています。 [...]

  65. Getting started with DroneCell and Arduino.

    [...] DroneCell and the GPS simultaneously. I stumbled upon this interesting behavior in NewSoftSerial. NewSoftSerial*|*Arduiniana. I seem to at least have something to go on… Using Multiple Instances There has been [...]

  66. Emular pines Serial de Arduino con la librería NewSoftSerial » Blog Archive » el blog de giltesa

    [...] eso es lo que es capaz de hacer la librería NewSoftSerial (más documentación aquí). Usándola podremos emplear el resto de pines como puertos serial, ya [...]

  67. Time - He's waiting in the wings - Cuyahoga

    [...] in the download is TimeGPS.pde, but it’s a touch outdated now that Mikal Hart’s NewSoftSerial library has been rolled up into the core (since 1.0) and renamed SoftwareSerial. The problem I had [...]

  68. Arduino的通讯扩展板介绍 | 爱板网

    [...] GPS模块与Arduino的通讯程序 [...]

  69. Giving Arduino a second UART over I2C by stacking another Arduino on top « CyclicRedundancy

    [...] tried using the SoftSerial (or the NewSoftSerial) library but ran into data corruptions even at the low speeds, so I decided to look for ways to get another [...]

  70. RFID Reader #1 « Tesla UIs

    [...] the example code. There some issues on the Arduino library SoftwareSerial, which changed to the NewSoftSerial once in a while. Share this:TwitterFacebookLike this:LikeBe the first to like this. Categories [...]

  71. Resources for the VCNL4000 IR Proximity Sensor | Sciencearium

    [...] - http://arduiniana.org/libraries/NewSoftSerial/ Share this: This entry was posted in AT Physics Class and tagged arduino, IR, proximity [...]

  72. Serial LCD do-it-yourself(DIY) kit | BUILD CIRCUIT

    [...] NewSoftSerial Library - Required for the example sketches. Sets up a second (third, fourth,…) serial port on the Arduino. [...]

  73. How to assemble serial LCD kit | BUILD CIRCUIT

    [...] NewSoftSerial Library - Required for the example sketches. Sets up a second (third, fourth,…) serial port on the Arduino. [...]

  74. Android talks to Arduino board - Arduino for ProjectsArduino for Projects

    [...] from this project (bluetooth_chat_LCD.pde attached below) – NewSoftSerial library from Mikal Hart: http://arduiniana.org/libraries/newsoftserial/ – Eclipse – Android Development Kit (explicitly follow all of Google’s installation [...]

  75. Burn Arduino Bootloader on an ATtiny45 for SoftwareSerial | No bread? Make it!

    [...] http://arduiniana.org/libraries/newsoftserial/ いいね:いいね 読み込み中… カテゴリー Arduino, [...]

  76. Burn Arduino Bootloader on an ATtiny for SoftwareSerial | No bread? Make it!

    [...] http://arduiniana.org/libraries/newsoftserial/ いいね:いいね 読み込み中… カテゴリー Arduino, [...]

  77. Please wait your turn! Stratoballoon GPS Sensor Sketch « Mark Gilbert's Blog

    [...] to the GPS receiver, I’d be writing to the data logger serially.  I found information here about running multiple devices serially – the short answer is that you have to access the serial [...]

  78. Going to Arduino from C#, Java, … string trouble | Hydroinformatix the Gaul

    [...] kB). I used this method and solved my intermitting (and making me crazy…) problems 2) Using PString library, added by NewSoftSerial and put in official version of Arduino. It is very handy: it hands you a [...]

  79. The Frustromantic Box, Part 4: Software | New Bright Idea

    [...] developers for the great libraries, and to Mikal Hart in particular for his work on the TinyGPS and NewSoftSerial [...]

  80. Le Dan-TECH » 2ème Partie : Reconnaissance vocale avec Arduino

    [...] , les ports 12 & 13 de l’arduino sont utilisés (liaison arduino-module via la classe newSoftSerial) et ne permettent pas l’emploi du shield Ethernet sur une platine « arduino [...]

  81. on the trail of the elusive Power Cost Monitor signal | We Saw a Chicken …

    [...] I rewrote the logger to use the Arduino’s internal UART, since — lovely though NewSoftSerial may be — it causes millis() to report wildly inaccurate times at low bit rates. I recorded a [...]

  82. 86duino

    [...] require that protocol. The version of SoftwareSerial included in 1.0 and later is based on the NewSoftSerial library by Mikal [...]

  83. 86duino

    [...] This requires the TinyGPS and NewSoftSerial libraries from Mikal Hart: http://arduiniana.org/libraries/TinyGPS and http://arduiniana.org/libraries/newsoftserial/ [...]

  84. Kerry D. Wong » Blog Archive » RF Data Link Using Si4021 And Si4311

    [...] BT1 pin settings (which are done in hardware), the receiver is totally configuration free. I used NewSoftSerial library in the code below. The main loop simply print out the incoming bit stream. You may also use [...]

  85. how to set up arduino + pololu mini maestro (for an 18 servo hexapod) | orange narwhals

    [...] newsoftserial should be downloaded from the internet and the folder inside the zip put in (path to where you [...]

  86. Starter Kit Sonar » Starter Kit

    [...] szczęście jest jeszcze jedna biblioteka „NewSoftSerial”, która jest pozbawiona tych wad i na dodatek obsługuje zanegowany sygnał [...]

  87. Twitter Poem Box -Use Arduino for Projects

    [...] Download the TrueRandom http://code.google.com/p/tinkerit/wiki/TrueRandom, NewSoftSerial http://arduiniana.org/libraries/newsoftserial/, and Twitter [...]

  88. Подключение GPS L30 модуля используя GPS Шилд от SparkFun » Arduino Market

    [...] NewSoftSerial [...]

  89. Tema 5 – Proyectos Arduino | Aprendiendo Arduino

    [...] NewSoftwareSerial: http://arduiniana.org/libraries/newsoftserial/ [...]

  90. Twitter Poem Box -Arduino for Projects

    [...] Download the TrueRandom http://code.google.com/p/tinkerit/wiki/TrueRandom, NewSoftSerial http://arduiniana.org/libraries/newsoftserial/, and Twitter [...]

  91. 아두이노의 통신 방법, 핀 정리 (Serial, UART, Software Serial, SPI, I2C) | Hard Copy Arduino

    [...] NewSoftSerial (Arduino IDE 1.0 이후 버전만 지원) – Serial 모듈별로 인스턴스를 생성해서 여러개를 사용할 수 있지만 한번에 하나의 인스턴스만 전송/수신 할 수 있습니다. 다른 라이브러리와의 충돌 가능성도 약간 있는 듯 합니다. http://arduiniana.org/libraries/newsoftserial/ [...]

  92. Please wait your turn! Stratoballoon GPS Sensor Sketch « Mark Gilbert's Blog

    [...] to the GPS receiver, I’d be writing to the data logger serially.  I found information here about running multiple devices serially – the short answer is that you have to access the serial [...]

  93. RFID cat door using Arduino -Use Arduino for Projects

    [...] This project consists of several ‘modules’ that you need to hook up to the Arduino and test in advance. First hook-up the RF reader. You can use the 5v output of the Arduino to power it, and a digital port (I used 2) to get the signal. The RDM630 that I used also has pins for a led that I don’t use. It also has an RX pin to send info back to the RF reader, but I don’t use that either. Hook-up your antenna, get a tag and use the serial monitor of the Arduino to see if it’s detected. Now you can also start working on improving the antenna by trying adding or removing turns, trying different shapes et cetera. Power the Adruino with the 9v power supply, not just USB because at least in my case that didn’t work. You can download the file named ‘rfid3.pde’ to test. The code requires NewSoftSerial.h which can be obtained here [...]

Leave a Reply