-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request #4
Comments
To compile and upload this to your arduino uno run
To compile without uploading run
Note that this should work on other atmega328 based development boards or on a breadboard, but you may need to modify the makefile. |
It looks like an extension to some code that I wrote. I would assume it works. My concern about the code is what has been added. They are sending pixels in an extremely nonoptimal way. It is better to simply send binary data then it is to convert it to text. Text conversion is slow and unnecessary. You will end up transferring up to four times as much data as text than you would sending the data as is. It also takes CPU time to do the conversion which means an even slower framerate. |
I have already done so much. To put this issue bluntly: I lack the motivation for some of these tasks. Others on the message board have made schematics and all you need to do is copy and paste the code into the Arduino IDE and rename a few functions. You will need to add WIFI support. |
Use google. I do not use the Arduino IDE. Add some code to blink the led to tell if it uploaded. Also if you want to use my frame grabber on windows you will need port it. |
I think the issue lies in the fact that you are not grasping the fact that I have code that is working and can be easily compiled. Just run
and the program will be compiled and uploaded to your board. No need to mess with the Arduino IDE. |
Thanks for all the help, |
Please do not blindly copy code without understanding what it does. While I appreciate your politeness I understand that the end goal is to get me to do a larger proportion of your project for you. My code does not send text (doing so is inefficient) and it does not use a baud rate that is supported by the serial monitor. Of course you will not see anything. You will need to come up with a program to capture the pixel data. My program can still function as a base see https://github.com/ComputerNerd/simpleFrameGrabber. |
Dude, |
Support is something extra. Also you deleted most of your comments most likely in hopes to make your comment appear true when it is not. Please do not do that. Fortunately Github emails me whenever you posted a comment so it turns out that deleting the comments did not accomplish much. That problem is I do not understand why you need support. I have already told you what you need to do. Also for everyone's reference here is the deleted comments. The more recent comments are at the bottom of this post. Edit: removed long code Sir, Hello, See I have used google enough and only answer I have got it your github repository or that it's not possible. Since you have done it only using arduino uno and OV7670(w/o FIFO) I want to just know exactly how to do it. please help |
Also I just noticed you had an arduino.stackexchange.com question. It provided more information that let me provide an answer that may advance your progress in getting this to work see http://arduino.stackexchange.com/questions/10170/how-to-use-code-for-ov7670-in-arduino-uno/10194#10194. |
Sir, |
I worried about offending you as well. I can get harsh when I suspect that I am doing lots of work for someone without the favor ever returned. Also thank you for providing me with more details on your project I have four words for you that may make your life easier: Get a webcam. You are sending this to your PC anyway so why not just skip the trouble and purchase a webcam. You can buy them on Ebay for less than $5.00 with shipping included (a price comparable to the ov7670). The quality can be improved by putting a better lens on the webcam. The reason I did all this work for the OV7670 is because I wanted a standalone system that could be used for a low power dedicated time lapse machine as an example. I also wanted to experiment with Raw Bayer data and I need more control over the image sensor. Do you need any of this? If not get a webcam. The reason these capture programs to the PC exist is primarily for testing purposes and any needed lens calibration. How about this. Try and tell me why you think you need the OV7670. |
Hello, |
Hello, Respectfully |
@arpit-reddfox You can have a digital wireless camera. There is no reason why a webcam will force you to use wires. You could get a low cost single board computer such as a raspberry pi and use the raspberry pi camera or plug in a webcam to it's USB port(s). |
hi ComputerNerd, also, once the code does upload, what am i supposed to look out for? will successful compilation of the code initate an applet on my screen within which i would be able to see my camera feed? please could you help sort out this confusion of mine! it would be of great help! thanks! |
Hi, didn't test it with the camera yet, but it uploaded to my arduino (Duemilanove) see here: |
Dear "ComputerNerd", thank you very much for sharing your work with us. I think there are a lot of people trying to get work the ov7670 and the documentation about it very good (check datasheet), but people expect to find already existing code which will take a picture with just calling a function like takeApictureForMe(). That is the problem with most of the people who work with Arduino, they have libraries for everything. Your code works, of course, and is compatible with a lot of microcontrollers, not just the Arduino's Atmega328. I am amazed that ONLY the user "eranws" was able to copy paste your work into an Arduino project AND compile it successfully (and actually it work). What could possibly go wrong if you copy-paste? I don't get it. Dear eranws, I suggest everyone to take a look at the datasheet of the module, because otherwise even if you get it work, some day it could (it will) stop and you won't know why because you won't be able to debug. |
I have gotten a bit behind on issues so I will respond to them in reverse chronological order. @TodorGinchev Yes I understand your point and my program comes close to that. I already have a takeApictureForMe() function called captureImg(). However before using it all you need to do is initialize the camera by calling camInit() and then set the resolution by using the setRes() function and set the pixel format using setColorSpace(). Then you can use the captureImg() function and it will send pixel data over UART. I would not be surprised if more people had success creating an INO; it is just that he posted about it. You are right not much can go wrong when copying and pasting. @eranws Tell me if it works. I will be interested to find out. @silvergravel I am confused by your post just as your are confused about mine. There is no way an applet will magically appear. You can use my frame grabber to capture an image https://github.com/ComputerNerd/simpleFrameGrabber To know that the code is working watch the TX LED light if it blinks/stays on it is working. If the LED on pin 13 is blinking it is not working. |
@ComputerNerd - I am a beginner to using I2C, and I found the LED 13 blinking when I used your simpleFrameGrabber program. Could you tell me some possible reasons for this? I really appreciate the help you are providing, and for spreading the joy of electronics! :) |
thanks guys @eranws thanks for compling the code in arduino IDE! i did manage to compile and upload computerNerd's code through the terminal though my project involves interfacing with a few other sensors etc, so your arduino version is going to be of huge help for that! still have to try the code though. @ComputerNerd thanks for the reply! im going to go ahead and try to compile the frameGrabber code.. |
@silvergravel - tell me if simpleFrameGrabber works for you. For me it is showing a green pixelated image which does not correspond to anything in front of it. @ComputerNerd - I got I2C working, but the problem of the green image is still there. Any suggestions? Thanks. |
Yes, you have 3 parameters if I am not wrong: baud rate, resolution and format. You have to match the parameters of the Arduino program with those of your FrameGrabber. I had not time to try it, but I will. Hope it will work. |
And BTW, it's not I2C, the data is sent via UART and the protocol that controls the camera is similar to I2C but it's not the same thing |
@TodorGinchev - can you please suggest a ready made solution to grab and view the image generated on USART ? |
@TodorGinchev - yes, you were right, I2C is not the same as SCCB, but for our purposes using this camera they can be considered the same, right? Anyway, I checked that the baudRate is 1M, the resolution is qQVGA. I still get extremely pixellated and noisy images. I really have no idea why it doesnt work. Any ideas? |
@abbanerjeersm - I heard that the minicom monitor utility for Ubuntu is extremely useful for UART...but I dont know how to view images using this utility. Try it out, tell me how it goes. |
@themathgeek13 : Unfortunately I use windows 7 - so installing linux seems to be a long way round. Lets see ... |
A ready made solution is the frame grabber. If you need Linux, you can always use a virtual machine, that is what I do because I still need windows for my work and cannot fully migrate to Linux. @themathgeek13 you at still missing the format, maybe that's your problem, you have raw, rgb565, etc |
@TodorGinchev - thanks for the suggestion, but that was not it. I tried all three formats, and it didnt work. I am using a 20.025 MHz quartz crystal oscillator for the clock signal. Does it need to be less than the Arduino's 16MHz for it to work? Does the HREF pin need to be connected anywhere? I dont think so, but I cannot find any other problems... |
@themageek13: No the clock frequency has no bearing on the UNO frequency if On Thu, Jun 11, 2015 at 12:26 PM, themathgeek13 [email protected]
|
Mmm, actually I am now having the same problem, I am receiving the data but not able to convert it into image with the FrameGrabber. But I didn't spent enough time debugging, I'll do it later. The program is showing "random" pixels... |
@themathgeek13 no. the simpleFrameGrabber is just not compiling for me. it gives me a bunch of warnings and ends with - as for the ov7670-no-ram-arduino program, it uploads onto the board but the led 13 light stays on and the tx light doesnt blink, so looks like im unable to make this program work either. :( |
Let's see. Here you have the .ino file and the compiled frameGrabber: The parameters between them are already matched (I think I did it correctly). So you only need to program the Arduino. If the RX LED of the Arduino is not blinking, then you did something wrong. After that, run the grabber with the command ./grab 320 240 yuv422 500000 /dev/ttyUSB0 1 You should get the image. I don't, maybe because I am using a VM. |
BTW @ComputerNerd I got segm fault sometimes: $ ./grab 160 120 yuv422 500000 /dev/ttyUSB0 1 |
Things that I may be doing wrong: pin 11 (the clock generated for the cam) I use it as 0 to 5V clock, not 0 to 3.3V. So the only thing that can go wrong is that the rising/falling time of the signal is so big that affects the readings of the camera (I have a signal where 2.49V is "Low limit" and 2.51 is "High limit" and the camera is expecting 1.64V as Low and 1.67V as high. But I think the rising/falling time should be neglegible and therefore there would be no difference between 5V or 3.3V clock (expect the fact that the camera can get burned hehe). The divider (register 0x11) is also to be taken into account, so I matched it also (25 for raw VGA and 21 for yuv422 qVGA) but I'm still not getting the desired signal. I indeed receive data, but the grabber considers it as "junk bytes". Any other ideas of what paramers I'm missing? |
@TodorGinchev - I tried your code as well, but I am getting the same random pixel output as before. @silvergravel - I am using Ubuntu 14.04 and I don't know anything about the Mac...maybe you need some libraries...check on Google. |
I found this on internet for register settings. I am still waiting for my http://mirrors.neusoft.edu.cn/rpi-kernel/drivers/media/i2c/ov7670.c On Fri, Jun 12, 2015 at 2:12 PM, themathgeek13 [email protected]
|
@TodorGinchev The reason you are getting a segmentation fault is because I forgot to mention that this program uses protocol version zero not version one so thus the last parameter should be a zero when using this program. You have a one for the last parameter. @abbanerjeersm I can tell that you did not read a response I sent to you about the fact that I got the registers from the Linux kernel driver as well. This looks like an older version however. |
@ComputerNerd : The latest datasheet I found on internet was version 1.9 - and I found many versions of linux drivers floating arround. For someone who wants to just get an image from this module is not particularly an easy learning curve. Anyways - I want to make the code more readable than yours - so I plan to make a arduino library for ov7670 when I get mine to test with. |
@abbanerjeersm Please post the link to version 1.9. |
@ComputerNerd : Here it is. I found this originally on http://wenku.baidu.com/view/ddb7362e0066f5335a812174.html?re=view but have created a new link in an english language website http://www.filedropper.com/ov7670-version191 |
That is the datasheet for the ov7660. The registers are very similar and it provides more information that is relevant to the ov7670. Thank you for reminding me of the existence of said sensor. In fact I believe that the ov7660 is better than the ov7670 as it is code compatible with the ov7670 but has larger pixels so that should mean better lowlight performance. I do not own an ov7660 but I would like to. |
@TodorGinchev not able to get the RX to blink :( im beginning to wonder if my connections are wrong. these are the connections have used - im gonna undo the connections are redo them again, and hope something changes, but other than that im really not sure what to do next :( |
@TodorGinchev could you send the link for the .ino file and the compiled frameGrabber please. |
Don't have it anymore, but just copy/paste the code that you get, this will do the work but of course you won't know how the camera operates... |
@ComputerNerd using cmd ?
@themathgeek13 Regarding the simpleFrameGrabber program that you've been trying , the LED 13 still blinking or already solved? |
Hi. I need help!!! @ComputerNerd |
can you upload a single sketch file for arduino... Or please tell me how to run the code...
The text was updated successfully, but these errors were encountered: