system
September 8, 2014, 8:23am
1
Hy
Currently I'm working on reading data from a device before they get to the transmitter.
Final goal is to read the data, as soon as a pause is detected send some additional data
to the transmitter.
Currently I like to use the SoftSerail port 2 and 3 to receive and send the data out.
This does not work. I use the code below:
while(c3.available() > 0){
byte tempit = c3.read();
c3.write(tempit);
}
However when I use the Hardware Serial Port it does work:
while(Serial.available() > 0){
byte tempit = Serial.read();
Serialwrite(tempit);
}
even when I read the data from the SoftSerial Port and send it through the Hardware port this works as well;
while(c3.available() > 0){
byte tempit = c3.read();
Serial.write(tempit);
}
Can someone help me to get this working an the tx SoftSerialPort
Andy
Robin2
September 8, 2014, 10:26am
2
SoftwareSerial cannot transmit and receive at the same time - you must choose one or the other.
I wonder if a slight delay between reading and writing would help - though it might not suit the logic of what you want to do.
...R
system
September 8, 2014, 6:37pm
3
Serialwrite(tempit);
Did anybody notice the missing FULL STOP in the "Serial.write(tempit); statement ?
Robin2
September 8, 2014, 7:47pm
4
raschemmel:
DID ANYBODY NOTICE THE MISSING DECIMAL POINT IN THE "Serial.write(tempit); statement ?
Surely it is a missingfull stop
...R
mart256
September 8, 2014, 9:15pm
5
Or change your micro to another capable of 2 hardware serial ports, some AVR examples (from cheaper to more expensive):
ATmega164A
ATmega164PA
ATmega324A
ATmega324PA
ATmega644A
ATmega644PA
ATmega1284
ATmega1284P
system
September 9, 2014, 4:39am
7
thx for all the comments.
Sorry it was a mistype otherwise it wouldn't compile
Hmm so I have to look for another micro... Hope there are PCB as small as the Arduino Pro Mini 328...
Andy
Robin2
September 9, 2014, 7:01am
8
raschemmel:
Surely it is a missing full stop
whatever....
Lighten up - it was meant as a joke.
...R