Before moving to the software side, you must properly configure the electronic components:
- Perform all the necessary steps to build the circuit, as shown in the following diagram:
- Compile and upload the following Sketch to Arduino:
int relay_pin_1 = 8;int relay_pin_2 = 9;String command;char receivedChar;// read from serial and concat it to commandvoid readFromSerial() { while (Serial.available() > 0) { receivedChar = Serial.read(); command.concat(receivedChar); delay(10); }}void setup() { // put your setup code here, to run once: pinMode(relay_pin_1, OUTPUT); pinMode(relay_pin_2, OUTPUT); digitalWrite(relay_pin_1, ...