Hi everyone i work on a project. I need when rfid==true then serial.println(1). I receive this value from visualstudio python with pyserial library. when value is = 1, i play a video with opencv.
'''
#include "pitches.h"
#include <SPI.h>
#include <MFRC522.h>
#define SS_PIN 10
#define RST_PIN 9
static const int buzzerPin = 2;
String UID = "CA C7 44 B4";
String UID1 = "A 6E 7F AD";
byte lock = 0;
String UID2 = "6A 73 27 B4";
MFRC522 rfid(SS_PIN, RST_PIN);
// Melody notes
void beep() {
tone(buzzerPin, 400, 300);
}
void setup()
{
Serial.begin(9600);
pinMode(buzzerPin, OUTPUT);
SPI.begin();
rfid.PCD_Init();
}
void loop()
{
if ( ! rfid.PICC_IsNewCardPresent())
return;
if ( ! rfid.PICC_ReadCardSerial())
return;
String ID = "";
for (byte i = 0; i < rfid.uid.size; i++) {
ID.concat(String(rfid.uid.uidByte[i] < 0x10 ? " 0" : " "));
ID.concat(String(rfid.uid.uidByte[i], HEX));
delay(300);
}
ID.toUpperCase();
if (ID.substring(1) == UID ||ID.substring(1) == UID1 ||ID.substring(1) == UID2 ) {
Serial.println(1);
beep();
delay(6000);
}
else {
Serial.println("Yanlish kart");
beep();
delay(50);
beep();
}
}
'''
my code is here. My code work properly and my video play properly it is okey. but now i want develop my project. i want use two computer the video's one side this computer other side is other computer. I dont want you help me in python code. I want just when rfid is true send signal(1) to two computer at the same time and video play at the same time. How connect other computer& how send the same signal other computer?