The following diagram depicts the conceptual view of Serial Data Communication between UNO and NANO using Hardware UART Port (UART Port) and Software UART Port (SUART Port).
Please download the attached pdf file for questions along with selective answers. Criticisms and comments are welcomed.
Exercise-1 for the readers: Write program to achieve the following objectives.
Enter 12x56y in the InputBox of Serial Monitor-1 using Keyboard of the PC, click on the Send Button of Serial Monitor-1; check that --
12
56
have appeared on the OutputBox of Serial Monitor-2.
Solution: (... in progress)
//Codes for UNO -- the Sender:
#include<SoftwareSerial.h> //this file is needed to create Software UART Port (UART Port)
SoftwareSerial SUART(2, 3); //SRX-pin = DPin-2 (Digital Pin-2 of UNO), STX-pin = DPin-3;
void setup()
{
Serial.begin(9600); //UART Port is enabled at Bd = 9600
SUART.begin(9600): //SUART Port is enabled at speed 9600
}
void loop()
{
}
Exercise-2 for the readers: Write program to achieve the following objectives.
(1) Use DVM (Digital Volt Meter) to measure DC voltages at A0-pin and A1-pin at the UNO (sender) side and record it as 2.35 and 4.15 (for example). These values will appear on Serial Monitor-2 in the following format:
Voltage received from A0-pin of UNO: xx.xx V Voltage received from A1-pin of UNO: xx.xx V
(2) Slowly vary the Pots (R1 and R2) at the UNO side; check that the readings of Serial Monitor-2 changes accordingly.
Edit: In view of Post#1.
Ch-5Questions.pdf (466 KB)