New i2c communication

This forum is dedicated to all issues and questions related to your individual setups and configurations
Post Reply
geennari
Posts: 3
Joined: Wed Oct 28, 2015 7:36 pm

New i2c communication

Post by geennari »

How can I open a new i2c communication?
I need to send one variable value to raspberry, so i can take a picture with it.

Cereal_Killer
Posts: 221
Joined: Fri Mar 06, 2015 5:44 am

Re: New i2c communication

Post by Cereal_Killer »

This will be challenging as multiwii isnt setup for external i2c comm's. Your best (and easiest) bet will be to use UART and communicate via the MSP (that's Multiwii Serial Protocol). MSP is a very well documented protocol with ready to use arduino libraries (you'll probably need to port those to RasPi, or maybe start with the linux library for RasPi. Or just google, someone somewhere is probably already doing it...)


If what you're doing is trying to trigger a RasPi based USB camera I would recommend skipping the multiwii all together, just let multiwii fly the copter and wire a spare radio channel directly into the RasPi to trigger the camera. Just have RasPi monitor a GPIO for PWM above 1500uS so it takes a pic when you flick a switch. Probably your best bet and the least coding involved.



If that's not what you're trying to do please share what it is that you want. What's the end goal?

geennari
Posts: 3
Joined: Wed Oct 28, 2015 7:36 pm

Re: New i2c communication

Post by geennari »

Yeah, i tried connecting the receptor directly with the GPIO port but it didn't work. From what I searched, all GPIO ports are digital. And I'm using the native Raspberry Pi Camera, not a USB one.
Now, i'm trying to use a ADC with the PI to read the analog signal from the receptor.
I have a Turnigy 9x RC and a Turnigy 9X8C receptor.

My goal is to trigger the Gear channel and take a picture with Raspberry Pi Camera. It's for my graduation project and it has to be done like this.

Chopper28
Posts: 2
Joined: Sun Nov 29, 2015 8:30 pm

Re: New i2c communication

Post by Chopper28 »

But I think digital is actually what you need.

The output on the receiver will typically be a repeating digital pulse of around 1mS long with the gear switch in one position, and 2mS long with it in the other. The Pi will have to detect the longer pulse, then trigger the camera.

Let us know how you get on.

geennari
Posts: 3
Joined: Wed Oct 28, 2015 7:36 pm

Re: New i2c communication

Post by geennari »

Hey guys, thanks for your help.

I found the easiest way of doing this. I'm using an Arduino Nano exclusively for receiving one channel from the receptor and speak with the Pi by I2C.
I know it's not the perfect way, but it did work. Now I can take pictures while flying the quad.

So, thanks :)

Chopper28
Posts: 2
Joined: Sun Nov 29, 2015 8:30 pm

Re: New i2c communication

Post by Chopper28 »

Well I was going to suggest that as a possible solution, I'm somebody who is perhaps a little too eager to reach for an Arduino for this kind of thing! As you say, maybe not the most elegant solution but hey, it gets the job done :) Glad you got it sorted.

Post Reply