Go Down

Topic: NewSoftSerrial (Read 1 time) previous topic - next topic

perkunas

I'm new to all this, so maybe its just me, but I cant get the NewSoftSerial working.
1st off the Arduino site tells you all kinds of stuff about it, but it doesn't give you a download link, or instructions on how to install it.
I downloaded it off another site its sitting on my desktop not even sure what version it is. Now what I'm lost.


Coding Badly


http://www.arduino.cc/en/Reference/Libraries

..."Contributed Libraries" section first paragraph.

robtillaart

download - http://arduiniana.org/libraries/newsoftserial/
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

perkunas

Ok tnx for the help, but here's my problem, Iv'e got code for a PH sensor
but when I compile it it says. "NewSoftSerial does not name a type."
I think that's because the NewSoftSerial program's not installed correctly.
I tried to follow the instructions to put it in the Sketch folder and restart, but as soon as I restart the program its not there poof gone, nothing to install.
Am I missing something?.


also; the cut paste wont work ether, but don't care much about that right now.




Coding Badly

Is this...

Code: [Select]
#include <NewSoftSerial.h>

...somewhere near the top of your Sketch?

perkunas

Yes
Ok got cut paste working, here is my sample code
Mind you I have nothing hooked up just trying to check the code.



#include <NewSoftSerial.h>
NewSoftSerial mySerial =  NewSoftSerial(2, 3);
char stamp_data[15];
byte holding;
byte i;
byte startup=0;
void setup(){
  mySerial.begin(38400);
  Serial.begin(38400);
          }
void loop() {
if(startup==0){
  for(i=1; i <= 2;i++){
      delay(1000);
     mySerial.print("l0");
     mySerial.print(13,BYTE);
     delay(1000);
     mySerial.print("l1");
     mySerial.print(13,BYTE);
}
startup=1;
delay(1000);
mySerial.print("c");
mySerial.print(13,BYTE);

if(mySerial.available() > 3) {
   holding=mySerial.available();
   for(i=1; i <= holding;i++){
       stamp_data= mySerial.read();
   }
for(i=1; i <= holding;i++){
     Serial.print(stamp_data);
   }
   Serial.println("");
 
  }
}




Tnx for the help.

robtillaart

please modify your post, select the code and press the # button to get a real code look,

Quote
I tried to follow the instructions to put it in the Sketch folder and restart

Libraries should not be in the sketch folder.

- http://www.arduino.cc/en/Reference/Libraries - Read the part Contributed libraries very carefully.
If you're using one of these libraries, you need to install it first. To do so, download the library and unzip it. It should be in a folder of its own, and will typically contain at least two files, one with a .h suffix and one with a .cpp suffix. Open your Arduino sketchbook folder. If there is already a folder there called libraries, place the library folder in there. If not, create a folder called libraries in the sketchbook folder, and drop the library folder in there. Then re-start the Arduino programming environment, and you should see your new library in the Sketch > Import Library menu.

You Arduino sketchbook folder can be found in the IDE -> filemenu -> preferences

Hopes this helps,
Rob
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

perkunas

Ok I think I found the problem, I'm using Ubuntu linux the libraries folder is locked down wont let my copy delete or do anything there.
I downloaded a program nautilus after trying to gain access all the other ways I know failed. Using that I just copied the NewsoftSerial File into the libraries file and it seems I'm in business. "What a Pain."
I'm sure I will be back soon with more questions.
Thanks for the help though.

mrtaylor

Libraries for Ubuntu should be in the sketchbook/libraries  directory.  I had to manually create the libraries directory.

Go Up