![]() ![]() Serial.println("this is a test") // making code is working - prints to serial monitor right? Serial.println(_TIMESTAMP_) // time of compile Serial.println(_FILE_) // double check the x.ino file void loop()ĭelay(2000) // just pause and some verification for serial monitor Here is something you may want to try as a test for both serial ports After a few weeks, I thought I would see if someone much smarter than me could shed some light on things for me. I have tried many different versions of this code such as using pins 2 and 3 for Rx and Tx, as well as other snippets I have found while researching my issue. My issue is mst likely due to my lack of uderstanding of how the serial function works, or serial communication in general. ![]() The TTL converter supports both 3.3v and 5v. Note: I am using a straight through cable. I removed the if(mySerial.available()) statement since there was no output, and it returns a -1, which I assume is telling me there is no data. Serial.println("this is a test") // making code is working set the data rate for the SoftwareSerial port SoftwareSerial mySerial = SoftwareSerial(rxPin, txPin) include the SoftwareSerial library so you can use its functions: I'm using the example code found in the arduino library. If I open a terminal emulator such as putty and connect at with the same vaules I'm attempting to use with my code, I see the same output. This is a sample of how the data is outputted: If I open excel or notepad, data is continuosly written to application. This is a sample of the string generated: The device coonected on the other end has the follwing capabilites:Īsynchronous, bi-directional, half-duplexĭata format Baud rate: 1200, 2400, 4800, 9600 bpsĭata: 7 bits + parity 1bit (even or odd) or 8 bits (non-parity) I'm using softwareserial on pins 9(Rx) and 8(Tx), and I have an RS232 TTL device connected to my Uno. I'm trying to use an Arduino Uno R3 to read data from a serial connection. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |