Offline
Newbie
Karma: 0
Posts: 9
|
 |
« on: September 21, 2012, 10:36:36 am » |
Hi guys, I recently bought egizmo serial camera, C328, can you help me interface it with my arduino? Thanks!!!!!! here is the camera http://www.e-gizmo.com/KIT/serial%20camera.html
|
|
|
|
|
Logged
|
|
|
|
|
Seattle, WA USA
Offline
Brattain Member
Karma: 316
Posts: 35566
Seattle, WA USA
|
 |
« Reply #1 on: September 21, 2012, 08:39:20 pm » |
The Technical Manual, available on the link you posted, shows that there are two ways to connect that camera to a computer, one of which is perfect for the Arduino. What do you need help with?
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 9
|
 |
« Reply #2 on: September 21, 2012, 11:05:58 pm » |
I've read previous posts about the arduino code on capturing images, btw I'm a newbie in arduino codes so I really need your help right here guys
the code goes like this
#include <CameraC328R.h> #include <NewSoftSerial.h> #define LED_PIN 13 #define PAGE_SIZE 64 #define USB_BAUD 115200 #define CAMERA_BAUD 14400 NewSoftSerial mySerial(2, 3); CameraC328R camera(&mySerial); uint16_t pictureSizeCount = 0; /** * This callback is called EVERY time a JPEG data packet is received. */ void getJPEGPicture_callback( uint16_t pictureSize, uint16_t packageSize, uint16_t packageCount, byte* package ) { // packageSize is the size of the picture part of the package pictureSizeCount += packageSize; Serial.write(package,packageSize); if( pictureSizeCount >= pictureSize ) { digitalWrite( LED_PIN, LOW ); Serial.flush(); } } void setup() { Serial.begin( USB_BAUD ); mySerial.begin(CAMERA_BAUD); pinMode( LED_PIN, OUTPUT ); digitalWrite( LED_PIN, LOW ); } void loop() { if( Serial.available() ){ while(Serial.read() != -1); digitalWrite( LED_PIN, HIGH ); if( !camera.sync() ) {
Serial.println( "Sync failed." ); return; } if( !camera.initial( CameraC328R::CT_JPEG, CameraC328R::PR_160x120, CameraC328R::JR_640x480 ) ) { Serial.println( "Initial failed." ); return; } if( !camera.setPackageSize( 64 ) ) { Serial.println( "Package size failed." ); return; } if( !camera.setLightFrequency( CameraC328R::FT_50Hz ) ) { Serial.println( "Light frequency failed." ); return; } if( !camera.snapshot( CameraC328R::ST_COMPRESSED, 0 ) ) { Serial.println( "Snapshot failed." ); return; } pictureSizeCount = 0; if( !camera.getJPEGPicture( CameraC328R::PT_JPEG, PROCESS_DELAY, &getJPEGPicture_callback ) ) { Serial.println( "Get JPEG failed." ); return; } } }
Ive downloaded properly the c328 and newsoftserial library but im still getting these errors :
In file included from sketch_sep22a.cpp:1: C:\Users\msi\Desktop\for Arduino Seminar\arduino-1.0\libraries\CameraC328R/CameraC328R.h:24:22: error: WProgram.h: No such file or directory C:\Users\msi\Desktop\for Arduino Seminar\arduino-1.0\libraries\CameraC328R/CameraC328R.h:25:24: error: WConstants.h: No such file or directory In file included from sketch_sep22a.cpp:2: C:\Users\msi\Desktop\for Arduino Seminar\arduino-1.0\libraries\NewSoftSerial/NewSoftSerial.h:33:2: error: #error NewSoftSerial has been moved into the Arduino core as of version 1.0. Use SoftwareSerial instead. In file included from sketch_sep22a.cpp:1: C:\Users\msi\Desktop\for Arduino Seminar\arduino-1.0\libraries\CameraC328R/CameraC328R.h:130: error: 'byte' has not been declared C:\Users\msi\Desktop\for Arduino Seminar\arduino-1.0\libraries\CameraC328R/CameraC328R.h:132: error: 'byte' has not been declared C:\Users\msi\Desktop\for Arduino Seminar\arduino-1.0\libraries\CameraC328R/CameraC328R.h:137: error: 'byte' does not name a type C:\Users\msi\Desktop\for Arduino Seminar\arduino-1.0\libraries\CameraC328R/CameraC328R.h:138: error: 'byte' does not name a type C:\Users\msi\Desktop\for Arduino Seminar\arduino-1.0\libraries\CameraC328R/CameraC328R.h:139: error: 'byte' has not been declared C:\Users\msi\Desktop\for Arduino Seminar\arduino-1.0\libraries\CameraC328R/CameraC328R.h:139: error: 'byte' has not been declared C:\Users\msi\Desktop\for Arduino Seminar\arduino-1.0\libraries\CameraC328R/CameraC328R.h:139: error: 'byte' has not been declared C:\Users\msi\Desktop\for Arduino Seminar\arduino-1.0\libraries\CameraC328R/CameraC328R.h:139: error: 'byte' has not been declared C:\Users\msi\Desktop\for Arduino Seminar\arduino-1.0\libraries\CameraC328R/CameraC328R.h:139: error: ISO C++ forbids declaration of 'byte' with no type C:\Users\msi\Desktop\for Arduino Seminar\arduino-1.0\libraries\CameraC328R/CameraC328R.h:141: error: 'byte' has not been declared C:\Users\msi\Desktop\for Arduino Seminar\arduino-1.0\libraries\CameraC328R/CameraC328R.h:144: error: ISO C++ forbids declaration of 'byte' with no type C:\Users\msi\Desktop\for Arduino Seminar\arduino-1.0\libraries\CameraC328R/CameraC328R.h:145: error: ISO C++ forbids declaration of 'byte' with no type C:\Users\msi\Desktop\for Arduino Seminar\arduino-1.0\libraries\CameraC328R/CameraC328R.h:121: error: 'NULL' was not declared in this scope In file included from sketch_sep22a.cpp:2: C:\Users\msi\Desktop\for Arduino Seminar\arduino-1.0\libraries\NewSoftSerial/NewSoftSerial.h:99: error: conflicting return type specified for 'virtual void NewSoftSerial::write(uint8_t)' C:\Users\msi\Desktop\for Arduino Seminar\arduino-1.0\hardware\arduino\cores\arduino/Print.h:48: error: overriding 'virtual size_t Print::write(uint8_t)' sketch_sep22a.cpp: In function 'void loop()': sketch_sep22a:62: error: invalid conversion from 'void (*)(uint16_t, uint16_t, uint16_t, byte*)' to 'void (*)(uint16_t, uint16_t, uint16_t, int*)' sketch_sep22a:62: error: initializing argument 3 of 'bool CameraC328R::getJPEGPicture(CameraC328R::PictureType, uint16_t, void (*)(uint16_t, uint16_t, uint16_t, int*))'
can you help me debug this errors? Ive placed the libraries in the libraries folder already
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 9
|
 |
« Reply #3 on: September 21, 2012, 11:45:18 pm » |
Im having problem with this line if( !camera.getJPEGPicture( CameraC328R::PT_JPEG, PROCESS_DELAY, &getJPEGPicture_callback ) ) { with this error invalid conversion from 'void (*)(uint16_t, uint16_t, uint16_t, byte*)' to 'void (*)(uint16_t, uint16_t, uint16_t, int*)' can you please help mee!! here is the tutorial http://sensorapp.net/?p=310
|
|
|
|
|
Logged
|
|
|
|
|
Gosport, UK
Offline
Faraday Member
Karma: 19
Posts: 3117
|
 |
« Reply #4 on: September 22, 2012, 03:24:43 am » |
C:\Users\msi\Desktop\for Arduino Seminar\arduino-1.0\libraries\CameraC328R/CameraC328R.h:24:22: error: WProgram.h: No such file or directory C:\Users\msi\Desktop\for Arduino Seminar\arduino-1.0\libraries\CameraC328R/CameraC328R.h:25:24: error: WConstants.h: No such file or directory That library is not compatible with the 1.0+ versions of the Arduino IDE. You're the second person to be asking about that library this week. As I said in the other thread: You need to either: . Use a pre-1.0 version of the IDE. . Find a newer version of the library, or contact the author and get them to update it. . Update it yourself. If you want to update it yourself, there are a number of things you need to do. . See point 2 at http://arduino.cc/forum/index.php/topic,97455.0.html. . The library makes use of NewSoftSerial. You will need to replace all occurrences of NewSoftSerial with SoftwareSerial. . Replace all: Serial.print(data,BYTE); with Serial.write(data); . There may be other things too.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 9
|
 |
« Reply #5 on: September 22, 2012, 03:53:38 am » |
Thanks Buddy, more arduino programming questions to come!
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Full Member
Karma: 2
Posts: 212
|
 |
« Reply #6 on: September 22, 2012, 04:08:36 pm » |
i am curious.. it turns out that the arduino has too little memory to store an image. One wouldnt put a arduino in between a cam if it can be attached directly. Are you sending the image to an extension board directly ? (wifi or ... ? )
And is the cam / arduino combination in .. well in speed match, because camera's can be fast.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 9
|
 |
« Reply #7 on: September 22, 2012, 11:25:04 pm » |
I'll get the image through the Processing as suggested by the tutorial, the baud rate for both the arduino and the serial camera is given, it will be stored in the processing project folder
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 1
|
 |
« Reply #8 on: September 30, 2012, 08:37:35 pm » |
The Technical Manual, available on the link you posted, shows that there are two ways to connect that camera to a computer, one of which is perfect for the Arduino. What do you need help with?
Sir Can I Request for an Overall (actual connections / codes) Tutorials / Guide for setting up an Arduino with a serial cam triggered by a PIR Sensor.. Captured picture must be on a desktop or laptop pc.. Thanks In Advance
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 9
|
 |
« Reply #9 on: September 30, 2012, 09:47:15 pm » |
my processing was able to display 'Read 4 bytes' only and the image that is being produced is Invalid T_T
|
|
|
|
|
Logged
|
|
|
|
|
Manaoag
Offline
Newbie
Karma: 0
Posts: 8
|
 |
« Reply #10 on: January 17, 2013, 02:57:03 pm » |
Who could give the updated code of the c328 serial camera..i really need this for our project...please help me!..thanks in advance..i will appreciate it a lot... 
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Dallas
Online
Shannon Member
Karma: 120
Posts: 10182
|
 |
« Reply #11 on: January 17, 2013, 06:25:00 pm » |
|
|
|
|
|
Logged
|
|
|
|
|
|