SCAM Class
- ID: scam
- Name: Serial Camera
- Other Names: Grove Serial Camera
- Category: other
- Manufacturer: seeed
- Connection: uart
- Link: http://www.seeedstudio.com/wiki/Grove_-_Serial_Camera_Kit
The driver was tested with the Serial Camera. There is no protocol documentation currently available, so this module was developed based completely on the Seeed Studio* Arduino* sketch.
It is connected via a UART at 115,200 baud.
Item Index
Methods
Properties
Methods
SCAM
-
uart
-
camAddr
Serial Camera constructor
Parameters:
-
uart
NumberDefault UART to use (0 or 1)
-
camAddr
Number3-bit address identifier of the camera; default is 0
Returns:
dataAvailable
-
millis
Checks to see if there is data available for reading
Parameters:
-
millis
NumberNumber of milliseconds to wait; 0 means no waiting.
Returns:
True if there is data available for reading
readData
-
buffer
-
len
Reads any available data into a user-supplied buffer. Note: the call blocks until data is available to be read. Use dataAvailable() to determine whether there is data available beforehand, to avoid blocking.
Parameters:
-
buffer
Uint8_t *Buffer to hold the data read
-
len
NumberLength of the buffer
Returns:
Number of bytes read
writeData
-
buffer
-
len
Writes the data in the buffer to the device
Parameters:
-
buffer
Uint8_t *Buffer to hold the data read
-
len
NumberLength of the buffer
Returns:
Number of bytes written
setupTty
-
baud
Sets up proper tty I/O modes and the baud rate. For this device, the default baud rate is 9,600 (B9600).
Parameters:
-
baud
Speed_tDesired baud rate
Returns:
True if successful
drainInput
()
Reads serial input and discards until no more characters are available
init
()
Boolean
Initializes the camera
Returns:
preCapture
-
fmt
Tells the camera to prepare for a capture
Parameters:
-
fmt
PIC_FORMATS_TOne of the PIC_FORMATS_T values
Returns:
doCapture
()
Boolean
Starts the capture
Returns:
True if successful
storeImage
-
fname
Stores the captured image in a file
Parameters:
-
fname
StringName of the file to write
Returns:
True if successful
getImageSize
()
Number
Returns the picture length. Note: this is only valid after doCapture() has run successfully.
Returns:
Image length