Hi everyone. I’m trying to connect a sensor via UART to the Notecarrier F but it doesn’t seem to work properly. I followed the example N. 50 in app-accelerators where the Rx and TX wires of the sensor are connected to F_RX and F_TX and a serial connection is defined as:
#define txRxPinsSerial Serial1
I also tried with both positions of the DFU switch.
Can someone explain how to do this connection properly?
Hi @abucknall, many thanks for your help! I have checked all you have mentioned:
The sensor I am using is the ultrasonic sensor A01NYUB from DFrobot. It is connected to the GND of the Notecarrier. The VCC of the sensor connected to VMAIN of the Notecarrier.
The specs of the sensor says operating voltage 3.3-5V.
I am using a Swan.
The connection are indeed RX → F_TX and TX→F_RX.
The baud rate of the sensor is 9600. The UART connection in the code is txRxPinsSerial.begin(9600).
The DFU switch is set to NORMAL.
After all these checks, I get four bytes sent by the sensor via UART, but the code does not seem to extract the payload (bytes 1 and 2) properly. The Header byte should be 255, which I am getting as byte number 4… So, I am reviewing the code to try to find a solution. Attached a photo.