So, Hardware hasn't been nice to us. After our voice recognition circuit failed, we had to start working on a plan C while we are waiting for the PCB to arrive. We decided to try to add image feeding to our project. The idea is that the car would have a camera, that would take pictures. These pictures would be sent to the user controlling the car via the xBee connected to the car mBed. The xBee of the user would then get the picture data, send it to the mBed of the user, which would create an image file that the user would be able to see.
We managed to run a simple program to take a picture, and save it on a file. Of course, we had to give you a picture of ... Jefta Jawi, who loves being in front of the camera.
From Camera |
Yes, he was posing for the camera.
But, at first we didn't go very past that. We had to find a way to send the image via the xBee, and then things started failing on us. Even our xBees that once worked fine, stopped working for awhile #don'tAskMeWhy.
New day, new trial, we got the xBees to transmit data once again. Yeah, I know. This just put us back where we were in the start, but it makes us happy to know that our xBees are not broken #hardwareFinallyGaveUsABreak.
Those of us who believe that late night coding is the best coding, you are RIGHT! Our program was tired of failing and we finally cut a break. We managed to have the mBed take a picture, save it on its local memory. Then, the file was open and copied to a second file. The proof is here:
Original Image
Image Copy
Yes, I know that this is just my lamp, but believe me: you don't want to see me on camera right now.
Now that we managed to open an image already taken and copy it into another file, we are ready to try to send the file via the xBee and writing it into the second mBed. Basically, most of our problems about writing into the file is that previously we were trying to hack the code to take the image, and send the file at the same time that it was being written #ABadIdea. So now open the file after it has being written seems to be a better option, since we will know the size of the packages that we are sending via the xBee.
Those who believe that late night coding is the best coding, should also believe that one needs to get some rest. Therefore, the xBee sending of the image will be left for tomorrow. If you are trying to take pictures with the mBed and the LS Y201 camera, here are some tips that really helped us: