Show Posts
Pages: [1] 2 3 4
1  Using Arduino / Programming Questions / Re: Baud Rate & Hardware Serial programming steps on: September 25, 2012, 02:41:04 am
Try adding
Code:
Serial.println("Incoming Data");
at the start of that if() statement.  Then try sending some more data to your Arduino from the GSM module.  Watch the terminal program and tell us the results.

Koop
2  Using Arduino / Programming Questions / Re: Baud Rate & Hardware Serial programming steps on: September 24, 2012, 10:45:01 pm
Quote
The Serial1.begin() command is only used on Arduino Megas, and has nothing to do with baud rates.
What do you think the argument is, then?

It most certainly DOES have to do with baud rates.

Sorry PaulS and santu0111, clearly my statement was far too ambiguous.  What I was attempting to say was that when you do or do not use
Code:
Serial1.begin()
has nothing to do with how fast your transmissions are, and only has to do with whether or not you're using a Mega.

Quote
The stuff you have before the infinite loop in loop() belongs in setup().
I agree with PaulS.  You should put
Code:
//Making GSM Module ON
  delay(500);
  digitalWrite(on,HIGH);
  delay(7000);
  digitalWrite(on,LOW);
  

In the setup() function, because you only want it done once.  Even though moving it has nothing to do with the functionality of the code, it just makes it look nicer.

Koop
3  Using Arduino / Programming Questions / Re: Baud Rate & Hardware Serial programming steps on: September 24, 2012, 06:06:04 am
The
Code:
Serial1.begin()
command is only used on Arduino Megas, and has nothing to do with baud rates.  If you're using an Uno, you should use the
Code:
Serial.begin()
command.

Koop
4  Using Arduino / Programming Questions / Re: Baud Rate & Hardware Serial programming steps on: September 24, 2012, 04:11:31 am
Well whether or not you want to always have the data from the GSM module always go to the terminal program on your computer will determine whether or not you can use hardware serial, because hardware serial can only have one connection at a time (USB counts as one connection)

Koop
5  Using Arduino / Programming Questions / Re: Baud Rate & Hardware Serial programming steps on: September 24, 2012, 03:02:59 am
I do think that the library will be able to handle that baud rate, so perhaps its the module?  If the library works with a 9600 baud rate, it should be able to work with a faster one.  Try replacing the 112500 baud GSM module with another one (if you have one).

Koop
6  Using Arduino / Programming Questions / Re: Baud Rate & Hardware Serial programming steps on: September 24, 2012, 02:39:55 am
This is just a guess, but I've had problems like this before with the SoftwareSerial library.  Try adding a delay (Try 500ms first then trial and error to get it as down low as possible) between the
Code:
if(cell.available() >0)

and
Code:
incoming_char=cell.read();    //Get the character from the cellular serial port.

Koop
7  Using Arduino / Programming Questions / Re: Baud Rate & Hardware Serial programming steps on: September 24, 2012, 02:25:38 am
Can you please post the code?  It would make it much easier to help you if we knew what we were dealing with...
8  Using Arduino / Programming Questions / Re: Using the RDM630 RFID Tag Reader and NewSoftwareSerial library on: July 13, 2012, 11:01:27 am
My problem was that I was taught BASIC at school - the old-fashioned version that required line numbers and pretty much only had for loops and GOTOs and GOSUBs as control structures.
Took me a while to get out of the habit when I learned ALGOL.
Glad I kicked it though.

I just started a computer technology class, and lucky for me, BASIC has come a long way in the past couple of years, so I probably (more like hopefully) won't have that problem.  And know that I know, I should be able to, even if I still 'need' to use gotos, I should be able to shake off the habit and keep it away smiley-razz
9  Using Arduino / Programming Questions / Re: Using the RDM630 RFID Tag Reader and NewSoftwareSerial library on: July 13, 2012, 01:58:28 am
Quote
A bit condescending.
Quote
Some of us never attended a university.
Sorry, Grumpy_Mike, AWOL and dxw00d!  In no means was that meant to be condescending, I just assumed that seeing as though you guys are so good at this, and you knew to never, EVER, use a goto (except in the circumstance said by Nick) you had some form of tertiary education on the matter.  Being a schoolkid, I've never experienced uni or TAFE or community college or any tertiary education, so I have no idea of how or what they teach you there.  It was just an (obviously uneducated) guess smiley-razz
10  Using Arduino / Programming Questions / Re: Using the RDM630 RFID Tag Reader and NewSoftwareSerial library on: July 12, 2012, 10:00:47 am
Quote
I didn't mean to come across too hard on the issue. The pins belong to the instance (and it doesn't matter what the instance is an instance of), so they should not be diddled with by you (or any one else). Only the class that you give them to should diddle with them.

You can, of course, look at the code, like I did, to see what is necessary, and what isn't, in the future.
Thanks for that.  Its hard to 'read' a person's emotions with only text to go by, and I thought that you were being one of those annoying nit-pickers, but you weren't so thats good smiley

Quote
The official Arduino page contains many, many errors. Not a one of us "experts" or moderators can change the official Arduino page.
Well that's not good is it :/  It should be checked for errors more frequently... and all examples I've ever seen do the same thing I did so it must be stemming from that one coding mistake.  Thanks for all your help.  I'll be sure to read the header files before I do anything with libraries again.

Thanks to you all,
Koop
11  Using Arduino / Programming Questions / Re: Using the RDM630 RFID Tag Reader and NewSoftwareSerial library on: July 12, 2012, 09:44:58 am
Quote
I'm changing their pinModes (even though its not really needed) because thats what it does in the SoftwareSerial tutorial:
It's on the internet. It must be right. Not in this case:

Code:
SoftwareSerial::SoftwareSerial(uint8_t receivePin, uint8_t transmitPin, bool inverse_logic /* = false */) :
  _rx_delay_centering(0),
  _rx_delay_intrabit(0),
  _rx_delay_stopbit(0),
  _tx_delay(0),
  _buffer_overflow(false),
  _inverse_logic(inverse_logic)
{
  setTX(transmitPin);
  setRX(receivePin);
}

And, what does setTX do?
Code:
void SoftwareSerial::setTX(uint8_t tx)
{
  pinMode(tx, OUTPUT);
  digitalWrite(tx, HIGH);
  _transmitBitMask = digitalPinToBitMask(tx);
  uint8_t port = digitalPinToPort(tx);
  _transmitPortRegister = portOutputRegister(port);
}

And setRX?
void SoftwareSerial::setRX(uint8_t rx)
{
  pinMode(rx, INPUT);
  if (!_inverse_logic)
    digitalWrite(rx, HIGH);  // pullup for normal logic!
  _receivePin = rx;
  _receiveBitMask = digitalPinToBitMask(rx);
  uint8_t port = digitalPinToPort(rx);
  _receivePortRegister = portInputRegister(port);
}

So, the pin modes have already been set when you diddle with them.
Well it was on the official Arduino page, which is supposed to be moderated by experts like you and your counterparts, so it's not like I grabbed it off Wikipedia and stuck it in my code.  Either way, nowhere have I read that you don't need to do that (At least anywhere on here), so obviously I'm not the only one, and no harm was done - the code works perfectly fine - so I don't think that any of this matters.
12  Using Arduino / Programming Questions / Re: Using the RDM630 RFID Tag Reader and NewSoftwareSerial library on: July 12, 2012, 09:34:29 am
See what I mean about attracting flak?   smiley-wink
Yep smiley-wink  I didn't realise that Goto was such a taboo!  It must be drilled into your heads at uni!
13  Using Arduino / Programming Questions / Re: Using the RDM630 RFID Tag Reader and NewSoftwareSerial library on: July 12, 2012, 09:28:13 am
Because it is mostly unnecessary (I have written one in the last thirty years, but it was deep in a Linux device driver, and required to be signed-off by a director), and has the potential of producing spaghetti code.
Fair enough.  It just seemed convenient and quick.  Its not like I used it a lot, only once.
14  Using Arduino / Programming Questions / Re: Using the RDM630 RFID Tag Reader and NewSoftwareSerial library on: July 12, 2012, 09:27:08 am
Quote
Code:
SoftwareSerial RFID =  SoftwareSerial(RFID_RX, RFID_TX);

  pinMode(RFID_TX, OUTPUT);//Define RFID TX pin as OUTPUT (Not nessesary)
  pinMode(RFID_RX, INPUT);//Define RFID RX pin as INPUT (Nessesary)
You have told the SoftwareSerial instance that the pins are its to manage. So, why are you diddling with them?
I'm changing their pinModes (even though its not really needed) because thats what it does in the SoftwareSerial tutorial:
http://arduino.cc/en/Reference/SoftwareSerialAvailable
15  Using Arduino / Programming Questions / Re: Using the RDM630 RFID Tag Reader and NewSoftwareSerial library on: July 12, 2012, 09:21:26 am
Quote
Your goto mess does not.
Why is Goto considered a 'mess', may I ask?
Pages: [1] 2 3 4