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