MKR 1010 with nRF problems!

so I've been able to create some code to transmit my HX711 load cell amp data from an arduino micro to a Uno. I've now swapped out the Uno for a MKR 1010 and the data received is getting messed up. below are some pictures of the original data as well as the data when its received. This error does not pop up when i used my Uno, so I'm wondering is this just some problem with the WiFi module interfering with the nRF? I've also added 10 microF capacitors to see if they would help but they didn't.

image
(the left side represents the actual load cell numbers, where as the right side numbers are the ones received wirelessly to the MKR1010)

code:

transmit code:

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#include "HX711.h"

// nRF details
#define CE_PIN   9
#define CSN_PIN 10
const byte linkAddress[6] = "link1";
RF24 nrf(CE_PIN, CSN_PIN); // Create a Radio

// load cell amp details
HX711 scale;
float calibration_factor = -45000; //-7050 worked for my 440lb max scale setup
float torque;

void setup() {
  
  Serial.begin(9600);

  // nRF setup
  nrf.begin();
  nrf.openWritingPipe(linkAddress); // setting up the address 
  nrf.setPALevel(RF24_PA_HIGH); // might need to change this
  nrf.stopListening(); // act as a transmitter

  // scale setup
  scale.begin(7, 6);
  scale.set_scale();
  scale.tare();
}


void loop() {
  
  scale.set_scale(calibration_factor);
  torque = scale.get_units();

  Serial.println(torque);

  nrf.write(&torque, sizeof(torque)); 

}

receive code:

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>

//define CE_PIN   9;
//#define CSN_PIN 10;

RF24 nrf(4, 5);

const byte linkAddress[6] = "link1";

float torque;
float data[1];

// ====================================

void setup() {

  Serial.begin(9600);

  while(!Serial) {
    
  }
  
  Serial.println("starting");

  
  nrf.begin();
  nrf.openReadingPipe(0, linkAddress);
  nrf.startListening(); // set nrf as receiever 

}

//=====================================

void loop() {

  if (nrf.available()) {

    nrf.read(&data, sizeof(data));

    Serial.println(data[0]);
  }
}

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.