Hello, I am trying to reproduce the following code to communicate in serial.
https://www.industrialshields.com/es_ES/blog/blog-industrial-open-source-1/post/como-utilizar-la-libreria-de-software-serial-en-el-controlador-industrial-arduino-plc-99
On the M-Duino 38R + the RX (SO), TX (SI) pins are respectively 50, 51
So, I wired tx from the device to RX MDuino and rx from the device to tx from MDuino
For information, here is the device with which I tried to communicate with M-Duino : https://learn.sparkfun.com/tutorials/sparkfun-rfid-starter-kit-hookup-guide
// https://github.com/PaulStoffregen/SoftwareSerial
#include <SoftwareSerial.h>
// https://github.com/agmangas/SerialRFID #include <SerialRFID.h> const byte RX_PIN = 50;//PIN_SPI_MISO; const byte TX_PIN = 51;//PIN_SPI_MOSI; SoftwareSerial sSerial(RX_PIN, TX_PIN); // RX (SO), TX (SI) SerialRFID rfid(sSerial); char tag[SIZE_TAG_ID]; char matchTag[SIZE_TAG_ID] = "5C00CADB5A17"; //SoftwareSerial mySerial(50, 51); // RX (SO), TX (SI) void setup() { Serial.begin(9600); sSerial.begin(9600); Serial.println(); Serial.println(">> Starting SerialRFID example program"); } void loop() { if (rfid.readTag(tag, sizeof(tag))) { Serial.print("Tag: "); Serial.print(tag); Serial.println(); //if (SerialRFID::isEqualTag(tag, matchTag)) //{ // Serial.println(" / Match: OK"); //} //else //{ // Serial.println(" / Match: No"); //} } }
I tested the following code on the arduino mega (basic) and it works ...
Response arduino mega (basic)
>> Starting SerialRFID example program Tag: 4300926D45F9 Tag: 4300926D45F9
Is there something I don't understand?
Thank you in advance for your answer.