Store › Forums › Video Experimenter › Bugs/Problems › connection problem
- This topic has 5 replies, 3 voices, and was last updated 11 years, 6 months ago by Shulyaka.
-
AuthorPosts
-
May 14, 2013 at 7:03 am #617marioMember
Hi Michael,
I have a project to make an optical length measurement, that requires me to have an overlay in the monitor to see the edge of the object. I already bought the Video Experimenter and Arduino UNO and everything is going well to have such an overlay on the monitor with this two device. But I faced a problem in the next step when the length magnet sensor attached. Is there any possibility to have a communication between Arduino + Video Experimenter to the sensor?The sensor itself has a SSI connection.
I already tried to make a clock with I2C connection and when I run the Arduino, the clock is flickering(not a sharp clock). I think there is some error in the timers that Video experimenter use to the Oscilloscope. It able to do just one task, I mean I have everything right with the clock without the video experimenter and vice versa. Maybe you have an idea to this problem?
I really appreciate for your help.
Regards,
Mario
May 14, 2013 at 7:20 pm #1655MichaelKeymasterBasically, generating a video signal consumes almost the entire CPU of the Arduino and requires very precise timing. It’s hard to use something like I2C at the same time you are generating a video signal.
If you look closely at the TVout library, there is the ability to attach a function to run during the vertical blanking interval (VBI). Look at this project where I used a Wii nunchuck (I2C) with TVout. http://nootropicdesign.com/projectlab/2011/03/20/tv-blaster/
It uses my Hackvision controllers library which has a stripped down, simplified I2C implementation that uses less memory. Maybe your sensor will work with simpler I2C implementation.
May 15, 2013 at 5:44 am #1656marioMemberHi Michael,
Thank you for your help. Right now I will check the project that you gave me the link above. Maybe it can be used for my project.
Regards,
Mario
May 15, 2013 at 8:10 am #1657marioMemberHi again Michael,
I see another post that has similar problem like me, and in that post you just giving a guide about the code.
void setVBIFlag() {
inVBI = true;
}tv.set_vbi_hook(&setVBIFlag);
if (inVBI) {
// communicate with compass here
inVBI = false; // reset the flag so we only try to communicate once per frame
}Is that right?Because, I’m just using that code inside my code and everything is fine when I’m compile the program, but it still doesn’t have a communication between the sensor and Arduino. It’s like the code never jump to the if (inVBI) part. I don’t have any idea why it is not working. Maybe you have any advise?
Thank you.
Best Regards.
Mario
May 16, 2013 at 4:24 pm #1658MichaelKeymasterInstead of passing a function to set the flag, just pass a function that performs the communication. So when you enter VBI, your function gets called and you do the work.
void readSensor() {
// read sensor
}
tv.set_vbi_hook(&readSensor);June 1, 2013 at 8:03 am #1682 -
AuthorPosts
- You must be logged in to reply to this topic.