Skip to content

Commit 9ac15ff

Browse files
authored
Fixed documentation errors
1 parent 7d52de6 commit 9ac15ff

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

README.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ There are many NPM modules for connecting to the Raspberry Pi camera, why use th
1414
- **Usable:** Video streams are available as `stream.Readable` objects that can be piped or listened to
1515
- **Tested:** Contains automated tests using Jest
1616
- **Modern:** Uses the latest ESNext features and up to date development practices
17-
- **Structure**: Ships with TypeScript defintion files
17+
- **Structure**: Ships with TypeScript definition files
1818

1919
## Install
2020
NPM
@@ -50,7 +50,7 @@ runApp();
5050

5151
Video capture:
5252
```javascript
53-
import { StreamCamera } from "pi-camera-connect";
53+
import { StreamCamera, Codec } from "pi-camera-connect";
5454
import * as fs from "fs";
5555

5656
// Capture 5 seconds of H264 video and save to disk
@@ -88,7 +88,7 @@ stillCamera.takeImage().then(image => {
8888

8989
Video capture:
9090
```javascript
91-
const { StreamCamera } = require("pi-camera-connect");
91+
const { StreamCamera, Codec } = require("pi-camera-connect");
9292

9393
const streamCamera = new StreamCamera({
9494
codec: Codec.H264
@@ -162,7 +162,7 @@ The GPU on the Raspberry Pi comes with a hardware-accelerated H264 encoder and J
162162
A standard NodeJS [readable stream](https://nodejs.org/api/stream.html#stream_class_stream_readable) is available after calling `startCapture()`. As with any readable stream, it can be piped or listened to.
163163

164164
```javascript
165-
import { StreamCamera, Codec } from "./src";
165+
import { StreamCamera, Codec } from "pi-camera-connect";
166166
import * as fs from "fs";
167167
168168
const runApp = async () => {
@@ -210,7 +210,7 @@ Note that this example produces a raw H264 video. Wrapping it in a video contain
210210
- [`SensorMode`](#sensormode)
211211

212212
## `StillCamera`
213-
A class for taking still images. Equivalent to running the raspistill command.
213+
A class for taking still images. Equivalent to running the `raspistill` command.
214214

215215
### `constructor (options: StillOptions = {}): StillCamera`
216216

@@ -291,18 +291,30 @@ Image rotation options.
291291
- `Rotation.Rotate180`
292292
- `Rotation.Rotate270`
293293

294+
```javascript
295+
import { Rotation } from "pi-camera-connect";
296+
```
297+
294298
## `Flip`
295299
Image flip options.
296300
- `Flip.None`
297301
- `Flip.Horizontal`
298302
- `Flip.Vertical`
299303
- `Flip.Both`
300304

305+
```javascript
306+
import { Flip } from "pi-camera-connect";
307+
```
308+
301309
## `Codec`
302310
Stream codec options.
303311
- `Codec.H264`
304312
- `Codec.MJPEG`
305313

314+
```javascript
315+
import { Codec } from "pi-camera-connect";
316+
```
317+
306318
## `SensorMode`
307319
Stream sensor mode options.
308320
- `SensorMode.AutoSelect`
@@ -314,6 +326,10 @@ Stream sensor mode options.
314326
- `SensorMode.Mode6`
315327
- `SensorMode.Mode7`
316328

329+
```javascript
330+
import { SensorMode } from "pi-camera-connect";
331+
```
332+
317333
These are slightly different depending on the version of Raspberry Pi camera you are using.
318334

319335
#### Camera version 1.x (OV5647):

0 commit comments

Comments
 (0)