Skip to content

Commit a498837

Browse files
committed
works now properly on avr boards
1 parent ba3c60f commit a498837

7 files changed

Lines changed: 119 additions & 90 deletions

File tree

examples/send_raw/send_raw.ino

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include "Arduino.h"
22
#include <Pelco_And_Arduino.h>
33

4-
PelcoCam PelcoCam(0x01, //Address of the camera
4+
PelcoCam MyPelcoCam(0x01, //Address of the camera
55
PELCO_D9600, //Config
66
32, //TX pin
77
33, //RX pin
@@ -10,11 +10,11 @@ PelcoCam PelcoCam(0x01, //Address of the camera
1010

1111
void setup() {
1212
//Begin the serial communication If you enabled logging, no need to begin the normal serial
13-
PelcoCam.begin();
13+
MyPelcoCam.begin();
1414

1515
//Send stop, send_command will return a bool that indicates if the cameras sended its ACK
1616
//It's a good way to see if the camera is plugged in
17-
while (!PelcoCam.send_command(STOP)) {
17+
while (!MyPelcoCam.send_command(STOP)) {
1818
Serial.println("Camera not plugged?");
1919
delay(1000);
2020
}
@@ -24,8 +24,8 @@ void setup() {
2424
void loop() {
2525
while(Serial.available()) {
2626
String in = Serial.readString(); //Read from the serial
27-
PelcoCam.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+
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)
2828
delay(500);
29-
PelcoCam.send_command(STOP); //Stop it after a while
29+
MyPelcoCam.send_command(STOP); //Stop it after a while
3030
}
3131
}

examples/set_position/set_position.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include "Arduino.h"
22
#include <Pelco_And_Arduino.h>
33

4-
PelcoCam PelcoCam(0x01, //Address of the camera
4+
PelcoCam MyPelcoCam(0x01, //Address of the camera
55
PELCO_D9600, //Config
66
32, //TX pin
77
33, //RX pin
@@ -10,11 +10,11 @@ PelcoCam PelcoCam(0x01, //Address of the camera
1010

1111
void setup() {
1212
//Begin the serial communication If you enabled logging, no need to begin the normal serial
13-
PelcoCam.begin();
13+
MyPelcoCam.begin();
1414

1515
//Send stop, send_command will return a bool that indicates if the cameras sended its ACK
1616
//It's a good way to see if the camera is plugged in
17-
while (!PelcoCam.send_command(STOP)) {
17+
while (!MyPelcoCam.send_command(STOP)) {
1818
Serial.println("Camera not plugged?");
1919
delay(1000);
2020
}
@@ -25,7 +25,7 @@ void loop() {
2525
//loops the camera increment angle of 1°; very fun because it shakes like hell
2626
int i=0;
2727
for(i=0; i<35999; i=i+100){
28-
PelcoCam.send_command(SET_PAN, i); //Hundered of degrees, max is 35999 == 359,99°
28+
MyPelcoCam.send_command(SET_PAN, i); //Hundered of degrees, max is 35999 == 359,99°
2929
delay(500);
3030
}
3131

examples/simple/simple.ino

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include "Arduino.h"
22
#include <Pelco_And_Arduino.h>
33

4-
PelcoCam PelcoCam(0x01, //Address of the camera
4+
PelcoCam MyPelcoCam(0x01, //Address of the camera
55
PELCO_D9600, //Config
66
32, //TX pin
77
33, //RX pin
@@ -10,11 +10,11 @@ PelcoCam PelcoCam(0x01, //Address of the camera
1010

1111
void setup() {
1212
//Begin the serial communication If you enabled logging, no need to begin the normal serial
13-
PelcoCam.begin();
13+
MyPelcoCam.begin();
1414

1515
//Send stop, send_command will return a bool that indicates if the cameras sended its ACK
1616
//It's a good way to see if the camera is plugged in
17-
while (!PelcoCam.send_command(STOP)) {
17+
while (!MyPelcoCam.send_command(STOP)) {
1818
Serial.println("Camera not plugged?");
1919
delay(1000);
2020
}
@@ -24,13 +24,13 @@ void setup() {
2424
void loop() {
2525

2626
//Pan to the left with max speed before turbo
27-
PelcoCam.send_command(PAN_L, 0x3F);
27+
MyPelcoCam.send_command(PAN_L, 0x3F);
2828
delay(1000);
29-
PelcoCam.send_command(STOP); //Stop the camera
29+
MyPelcoCam.send_command(STOP); //Stop the camera
3030
delay(1000);
3131
//Pan to the left with less speed than the tilt speed that goes up
32-
PelcoCam.send_comand(PAN_L_TILT_U, 0x10, 0xFF);)
32+
MyPelcoCam.send_command(PAN_L_TILT_U, 0x10, 0xFF);
3333
delay(1000);
34-
PelcoCam.send_command(STOP); //Stop the camera
34+
MyPelcoCam.send_command(STOP); //Stop the camera
3535
delay(1000);
3636
}

library.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
name=Pelco_And_Arduino
2-
version=2.0.0
2+
version=2.5.0
33
author=Boris Hilkens <pixelbo21@gmail.com>
44
maintainer=Boris Hilkens <pixelbo21@gmail.com>
55
sentence=This library makes Pelco cameras moves!
66
paragraph=WARN: not entirely tested
77
category=Communication
88
url=https://github.com/Pixelbo/Pelco_And_Arduino
9-
architectures=avr, esp32
9+
architectures=avr
1010
includes=./src/Pelco_And_Arduino.h

0 commit comments

Comments
 (0)