The modules are the following: NRF24L01...? - Album on Imgur This is their respective AlieExpress page: https://aliexpress.com/item/4000317884559.html?gatewayAdapt=glo2nld I am trying to send test
through C# to my Arduino but once I actually send it over, the following is being received:
`teeeeeeeesetts
etts
eteeeeeeeeeeeeeeeeeeeeeeeeeeeeeestttt
ttttttteeeeeeeeeeeee`
This tells me that the connection works and data is actually being received but there's something wrong with either sending or receiving. I'm personally guessing something being wrong with sending but I'm not sure.
What could I try in order to receive just plain "test"?
The C# code:
using System.IO.Ports;
namespace ArduinoCom
{
class Program
{
static void Main(string[] args)
{
SerialPort port = new SerialPort("COM3", 115200, Parity.None, 6);
port.Open();
bool run = true;
int counter = 0;
for (int i = 0; i < 1000; i++)
{
port.Write("test\n");
}
port.Dispose();
port.Close();
}
}
}
The Arduino code is as follows:
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#include <Wire.h>
#include <I2C_LCD.h>
I2C_LCD LCD;
uint8_t I2C_LCD_ADDRESS = 0x51; //Device address setting, default: 0x51
SoftwareSerial mySerial(0, 1); // RX, TX
RF24 radio(7, 8); // CE, CSN
void setup() {
Serial.begin(115200);
Wire.begin();
Serial1.begin(115200);
}
void loop() {
LCD.CleanAll(WHITE);
LCD.FontModeConf(Font_6x8, FM_ANL_AAA, BLACK_BAC);
if (Serial1.available()) {
{
Serial.print((char)Serial1.read());
LCD.DispStringAt((char)Serial1.read(), 0, 10);
}
}
}