Hello,
I get the value I want to get from nRF52840 but it also gives me the value 0 inbetween the real values.
What is the issue here?
nRF52840 code below,
#include <Arduino.h>
#include <Adafruit_TinyUSB.h>
#include "LSM6DS3.h"
#include "Wire.h"
//Create a instance of class LSM6DS3
LSM6DS3 myIMU(I2C_MODE, 0x6A); //I2C device address 0x6A
void setup() {
Serial.begin(115200);
delay(1000);
while (!Serial);
//Call .begin() to configure the IMUs
if (myIMU.begin() != 0) {
Serial.println("Device error");
} else {
Serial.println("Device OK!");
}
Serial1.begin(115200);
delay(1000);
}
void loop() {
Serial.print("\nAccelerometer:\n");
Serial.print(" X1 = ");
Serial.println(myIMU.readFloatAccelX(), 4);
value = myIMU.readFloatAccelX()
Serial1.println(value);
while(Serial1.available()>0) {
char c = Serial1.read();
Serial.print(c);
}
}
ESP32S3 code below,
#include <HardwareSerial.h>
#include <Arduino.h>
#include <WiFi.h>
#include <WiFiMulti.h>
WiFiMulti wiFiClient;
#define USE_SERIAL Serial
//WiFi connection
const char * WIFI_SSID ="777777";
const char * WIFI_PASSWORD = "yyyyyy";
HardwareSerial MySerial0(0);
void setup() {
// USE_SERIAL.begin(921600);
USE_SERIAL.begin(115200);
Serial.setTxTimeoutMs(0); // maybe needed for Serial.print()
delay(500);
wiFiClient.addAP(WIFI_SSID, WIFI_PASSWORD);
// WiFi.disconnect();
while(wiFiClient.run() != WL_CONNECTED)
{
Serial.printf(".");
delay(100);
}
Serial.printf("Connected to the WiFi!");
MySerial0.begin(115200, SERIAL_8N1, -1, -1); // default TX~D6 RX=D7
delay(500);
}
int* readRXTXData(){
if(MySerial0.available() > 0) {
int temp_char = MySerial0.parseInt();
Serial.print("TEMP CHAR ");
Serial.println(temp_char);
}
void loop() {
readRXTXData();
}
Thanks in advance.