Skip to content

Commit ee85a20

Browse files
committed
ACK + compability + readme + better setup
1 parent 7d6a02e commit ee85a20

7 files changed

Lines changed: 384 additions & 192 deletions

File tree

.development

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.md

Lines changed: 77 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,78 @@
1-
## Pelco and arduino
1+
# Pelco and arduino
22

3-
Library made for the purpose of this project: https://hackaday.io/project/183986-controlling-a-cctv-camera-with-arduino still in development!
3+
> Photography has nothing to do with cameras.
4+
5+
![A Pelco Camera](the%20eye%20of%20sauron.jpg)
6+
7+
## Overview
8+
9+
Hello, this is an Arduino library designed to control Pelco Cameras!
10+
11+
For now it can support PELCO-D protocol but I havn't got tested everything yet.
12+
13+
This library was made for the project: [Controlling a cctv camera on Arduino](https://hackaday.io/project/183986-controlling-a-cctv-camera-with-arduino) on hacakday.io
14+
15+
Before you go on, this is a school, project, I'm still in school and learnings things so be kind if the libray is ugly. I would like to thanks my school and teachers for allowing me to work on this project.
16+
17+
The main goal of the project is to do a control table (It'll be on arduino.)
18+
19+
Anyway, here the table of contents:
20+
21+
## Table of Contents
22+
- [Pelco and arduino](#pelco-and-arduino)
23+
- [Overview](#overview)
24+
- [Table of Contents](#table-of-contents)
25+
- [Requirements](#requirements)
26+
- [Exemple](#exemple)
27+
28+
29+
## Requirements
30+
31+
This is a bit obvious but you'll need a Pelco camera, the one I use the ES4036.
32+
33+
The important thing is to set the camera is RS485 biderectional and with the baud of your chossing. For now, the lib only support Pelco-D protocol.
34+
35+
About the modules for RS485, I'm working with a standart MAX485 chip but I'll test a more advanced module on the future.
36+
37+
## Exemple
38+
39+
```arduino
40+
#include "Arduino.h"
41+
#include <Pelco_And_Arduino.h>
42+
43+
int Pan_position = 0;
44+
45+
PelcoCam PelcoCam(0x01, //Address of the camera
46+
PELCO_D9600,//Config
47+
32, //TX pin
48+
33, //RX pin
49+
true, //Enable logging?
50+
25); //RE pin for manual switching modules
51+
52+
void setup() {
53+
54+
//Begin the serial communication If you enabled logging, no need to begin the normal serial
55+
PelcoCam.begin();
56+
57+
//Send stop, send_command will return a bool that indicates if the cameras sended its ACK
58+
while (!PelcoCam.send_command(STOP)) {
59+
Serial.println("Camera not plugged?");
60+
delay(1000);
61+
}
62+
Serial.println("Init Finished!");
63+
}
64+
void loop() {
65+
66+
//Pan to the left with max speed before turbo
67+
PelcoCam.send_command(PAN_L, 0x3F);
68+
69+
//send a request about the pan position
70+
Pan_position = PelcoCam.send_request(QUERY_PAN);
71+
Serial.println(Pan_position);
72+
73+
delay(1000);
74+
75+
PelcoCam.send_command(STOP); //Stop the camera
76+
delay(1000);
77+
}
78+
```

library.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name=Pelco_And_Arduino
2-
version=0.0.1
2+
version=1.0.0
33
author=Boris Hilkens <pixelbo21@gmail.com>
44
maintainer=Boris Hilkens <pixelbo21@gmail.com>
55
sentence=This library makes Pelco cameras moves!
6-
paragraph=It support for now the protocol PelcoD via RS485 (only tested on ES4036)
6+
paragraph=WARN: not entirely tested: will have to wait a couple of weeks
77
category=Communication
88
url=https://github.com/Pixelbo/Pelco_And_Arduino
99
architectures=avr, esp32

0 commit comments

Comments
 (0)