You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
8); // RE pin for manual switching modules set to -1 if it is a auto module (like a groove one)
4
+
PelcoCamBus MyPelcoBus(6, // TX pin (Arduino to Cam)
5
+
7, // RX pin (Cam to Arduino)
6
+
8); // RE pin for manual switching modules set to -1 if it is a auto module (like a groove one)
10
7
11
8
voidsetup() {
9
+
12
10
Serial.begin(9600);
13
11
14
-
//Begin the serial communication
15
-
MyPelcoCam.begin();
12
+
//Begin the serial communication
13
+
MyPelcoBus.begin(PELCO_D9600, true);
16
14
17
-
//Send stop, send_command will return a bool that indicates if the cameras sended its ACK
18
-
//It's a good way to see if the camera is plugged in
19
-
while (!MyPelcoCam.send_command(STOP)) {
15
+
//Send stop, send_command will return a bool that indicates if the cameras sended its ACK
16
+
//It's a good way to see if the camera is plugged in
17
+
while (!MyPelcoBus.send_command(1, STOP)) {
20
18
Serial.println("Camera not plugged?");
21
19
delay(1000);
22
20
}
@@ -26,8 +24,8 @@ void setup() {
26
24
voidloop() {
27
25
while(Serial.available()) {
28
26
String in = Serial.readString(); //Read from the serial
29
-
MyPelcoCam.send_raw(in); //Send the raw command to the cameras (adress can be another than the one declared in the object because it's raw transmission)
27
+
MyPelcoBus.send_raw(in); //Send the raw command to the cameras (adress can be another than the one declared in the object because it's raw transmission)
30
28
delay(500);
31
-
MyPelcoCam.send_command(STOP); //Stop it after a while
29
+
MyPelcoBus.send_command(1, STOP); //Stop it after a while
0 commit comments