Hello all,
I have recently bought an ADNS9800 laser motion sensor from Tindie
Now I would like to make a frame capture test just like it is done in this video
According to the datasheet which can be found here, I know which registers to read, however what I do not know is how to display it. After writing the code, I will be able to read pixel values, however I do not have an opinion on how to display all of these pixel values as a whole image.
Could you please give me a hand?
Regards
Do you want to display it on a device attached to an arduino or your PC?
If the latter you need to write some code on the PC to recieve serial data and display it. The Processing language is one popular way to to this. At the Arduino end you just pump out the pixel data on the serial port.
Yes, just like in the video I referred to, I would like to display it on my PC.
Are there any similar projects that is done with The Processing which is similar to what I would like to accomplish, that you can suggest to me?
that you can suggest to me?
No but it is not very difficult.
Get processing and load in this example from the IDE's file menu. Examples -> Basic -> Create Image
This creates a basic image and plots it on the screen at the mouse position.
You will notice that you filled up the array that makes up the image with the img.pixels[] method. Play about with putting your own values here, maybe use a random number generator, get the feel of putting pixels in an image array.
Then look at the Examples -> Library -> Serial -> SimpleRead and see how to open up the serial port connected to an Arduino and get data from it. It even has example Arduino code to send data. Run that and get used to what it is doing.
Then combine the two so that data sent from the Arduino is put into the image array. At this point do not try and use your sensor, just send a data pattern that you know and get it to display. Then get the Arduino to send a sequence of data "frames".
Only when this is working should you try an attach your sensor and send the data from that.
Did you get this to work?
I have the same issue but I want to display the image in C# instead of in Processing.
I have not found how to "convert" the img.pixel[] to eqvivalent c# code.
Regards
I am trying to catpure images with the optcial flow sensor just like you.
But i am new on coding.
Would you please share me the code for my reference?