GROVESCAM Class
- ID: grovescam
- Name: Serial Camera Module
- Category: other
- Manufacturer: seeed
- Connection: uart
- Link: http://www.seeedstudio.com/wiki/Grove_-_Serial_Camera_Kit
The driver was tested with the Grove 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
GROVESCAM
                      
                              - 
                                              uart
- 
                                              camAddr
Grove Serial Camera constructor
Parameters:
- 
                                              uartNumberDefault UART to use (0 or 1) 
- 
                                              camAddrNumber3-bit address identifier of the camera; default is 0 
Returns:
dataAvailable
                      
                              - 
                                              millis
Checks to see if there is data available for reading
Parameters:
- 
                                              millisNumberNumber 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:
- 
                                              bufferUint8_t *Buffer to hold the data read 
- 
                                              lenNumberLength of the buffer 
Returns:
Number of bytes read
writeData
                      
                              - 
                                              buffer
- 
                                              len
Writes the data in the buffer to the device
Parameters:
- 
                                              bufferUint8_t *Buffer to hold the data read 
- 
                                              lenNumberLength 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:
- 
                                              baudSpeed_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:
- 
                                              fmtPIC_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:
- 
                                              fnameStringName 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