MKR1010 with RS485 Shield basics issue (RESOLVED)

Hello,
ideas please as to why I am seeing
h��K��
��K��
hello: 24
h��K��
��K��
hello: 27

when I load and run the sketches as per the details mkr485 comms

I have triple checked the sketch - it is obviously talking as 'hello: nnn' is printed to the serial port some of the time, the count is correct as example above 24 two dodgy lines (25,26) followed by 27 so sequence is intact.

All screw terminals have been checked for tightness.

So why the garbage?

to be clear I have:
2 * MKR1010
2* MKR485 shield
The shields are on top of the MKR1010
The power is supplied from a 'Y' cable, that is a split power from a voltage/current controlled Supply.
The grounds of all elements have continuity.

CODE: Sender

#include <SPI.h>
#include <ArduinoRS485.h>
#include <ArduinoIoTCloud.h>
#include <Arduino_ConnectionHandler.h>
#include "myvars.h"

void setup() {
  Serial.begin(9600);
  delay(100);
  RS485.begin(9600);    
}

void loop() {
  Serial.println("THIS IS THE SENDER Change  me over chap");
  Serial.println("");
if (counter <=100) {  
  RS485.beginTransmission();
  RS485.print("hello: xxx : " );
  RS485.println(counter);
  RS485.endTransmission();

  counter++;
  delay(100);
} else {

counter = 0;
}

}

CODE Receiver:

#include <ArduinoIoTCloud.h>
#include <Arduino_ConnectionHandler.h>
#include <ArduinoRS485.h>
void setup() {
  Serial.begin(9600);
  while (!Serial);

  RS485.begin(9600);

  // enable reception, can be disabled with: RS485.noReceive();
  RS485.receive();
}

void loop() {
   if (RS485.available()) {
    Serial.write(RS485.read());
  }
}

Thanks
Stephen

So for anybody who cares... Resolved, this bit anyway.

I decided to change the RS485 serial speed -- From 9600 to 4800 and all is well with the world.
Who'd have thunk it :slight_smile:

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