Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Ricardo committed Jun 27, 2015
1 parent 93f28de commit 1e8f142
Showing 1 changed file with 90 additions and 5 deletions.
95 changes: 90 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,14 @@ var myCamera = new Foscam({
pwd: 'your-password
});
//The camera will move right for 4 seconds and the it will stop
myCamera.ptzMoveRight(4000);
myCamera
.ptzMoveRight(4000)
.then(function(){
//DO SOMETHING AFTER THE CAMERA HAS MOVED FOR 4 SECONDS
});
```
Expand Down Expand Up @@ -45,7 +51,7 @@ var myCamera = new Foscam({

### ptzMoveUp ( [time] )

In order to connect to the camera you first need to provide its access details. This will create an object for that particular camera. You can create as much objects as you need, so you can control multiple cameras.
Most of the methos are based on promises. To move the camera, you just call the corresponding method, optionally indicating for how long you want the camera to move

name | type | default | description
-----|--------|---------------|----------------------
Expand All @@ -55,10 +61,16 @@ time | int | | Value in miliseconds before stop
```js

//The camera will move Up for 2 seconds
myCamera.ptzMoveUp(2000);
myCamera
.ptzMoveUp(2000)
.then(function() {
//THE CAMERA ALREDY MOVES FOR 2 SECONDS
);

```
Next methods are equivalent, just change the action they send to the camera. I think names are self explanatory.
### ptzMoveDown ( [time] )
### ptzMoveRight ( [time] )
### ptzMoveLeft ( [time] )
Expand Down Expand Up @@ -92,7 +104,7 @@ myCamera
### setPTZSpeed ( speed )
This method allow you to set the speed of the camera. Valid values comes from 0 to 4, being 0 the slowest and 4 the fastest speed.
Update the speed of the camera. Valid values comes from 0 to 4, being 0 the slowest and 4 the fastest.
name | type | default | description
------|--------|---------------|----------------------
Expand All @@ -109,3 +121,76 @@ myCamera
});

```
### getPTZPresetPointList ( )
Returns the count of how many presets the camera has and a list with the names of all of the points
```js

//The camera will move Up for 2 seconds
myCamera
.getPTZPresetPointList()
.then(function(results) {
//DO WHAT YOU NEED WITH THE RESULTS
});

```
### ptzAddPresetPoint ( name )
Add a new preset point with the given name. The preset point is the current position of the camera, including its pan/tilt/zoom.
name | type | default | description
------|--------|---------------|----------------------
name | string | | The name for the preset point
```js

myCamera
.ptzAddPresetPoint('MyPresetPoint')
.then(function() {
//YOUR POINT HAS BEEN ADDED
});

```
### ptzDeletePresetPoint ( name )
Deletes the preset with the given name
name | type | default | description
------|--------|---------------|----------------------
name | string | | The name for the preset point
```js

myCamera
.ptzDeletePresetPoint('MyPresetPoint')
.then(function() {
//YOUR POINT HAS BEEN DELETED
});

```
### ptzGotoPresetPoint ( name )
The camera moves to the preset with the given name
name | type | default | description
------|--------|---------------|----------------------
name | string | | The name for the preset point
```js

myCamera
.ptzGotoPresetPoint('MyPresetPoint')
.then(function() {
//WARNING! AT THIS POINT THE CAMERA IS NOT AT THE PRESET POINT
//ITS JUST MOVING TOWARD IT
});

```

0 comments on commit 1e8f142

Please sign in to comment.