Bluetooth + Multiwii

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
Post Reply
Theelectronicguy
Posts: 49
Joined: Tue Dec 06, 2011 3:12 am

Bluetooth + Multiwii

Post by Theelectronicguy »

I want to use the multiwii code with an android phone, I activated the BTSERIAL, but I can't seem to find the code to send for controlling the yaw, pitch and roll. Does anyone know what it should look like(ex: 10r for set roll to 10)

Thanks

timecop
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: Bluetooth + Multiwii

Post by timecop »

No.
Look under the 'K' command inside serialCom()

Code: Select all

#ifdef BTSERIAL
        case 'K':              //receive RC data from Bluetooth Serial adapter as a remote
            rcData[THROTTLE] = (Serial.read() * 4) + 1000;
            rcData[ROLL] = (Serial.read() * 4) + 1000;
            rcData[PITCH] = (Serial.read() * 4) + 1000;
            rcData[YAW] = (Serial.read() * 4) + 1000;
            rcData[AUX1] = (Serial.read() * 4) + 1000;
            break;
#endif


You send 5 bytes, 0..255, which gets multiplied by 4 to get microseconds, then added 1000 to get the usual rc pulse.
So to get 1500, you send 125. Obviously, the order is as stated in the code above

User avatar
Hamburger
Posts: 2582
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Bluetooth + Multiwii

Post by Hamburger »

which android app do you use for sending, please?

timecop
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: Bluetooth + Multiwii

Post by timecop »

I'm guessing hes writing his own

Theelectronicguy
Posts: 49
Joined: Tue Dec 06, 2011 3:12 am

Re: Bluetooth + Multiwii

Post by Theelectronicguy »

Yeah, well im going to write my own code but you should check this out:

http://fr.appbrain.com/app/multiwii-bt- ... s.bicopter

http://www.amarino-toolkit.net/

Theelectronicguy
Posts: 49
Joined: Tue Dec 06, 2011 3:12 am

Re: Bluetooth + Multiwii

Post by Theelectronicguy »

Also, thanks for the quick reply !

Theelectronicguy
Posts: 49
Joined: Tue Dec 06, 2011 3:12 am

Re: Bluetooth + Multiwii

Post by Theelectronicguy »

Man I was about to start programming when I realized I dont know what AUX1 is?!?!?

timecop
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: Bluetooth + Multiwii

Post by timecop »

What about it? Its just one of RC channels, I thought? i.e. you can assign it to switch/knob/whatever, and in GUI you can configure it to turn on/off autolevel/etc. You can just send 1500 on it if you don't care.

Theelectronicguy
Posts: 49
Joined: Tue Dec 06, 2011 3:12 am

Re: Bluetooth + Multiwii

Post by Theelectronicguy »

Ok, If you can answer this last question, it would be awsome. I made the code and nothing, NOTHING, happens. The motors arm even if I didnt connect my phone, my baud rate is good and I made a little sketch to see if I receive the values and I sure do. Is there something like an arming sequence(even if motors are armed) that I need to do? Or something that may be obvious but heres what I write:

Code: Select all

ons.write(Throttle); // Throttle
        ons.write(Roll); // Roll
        ons.write(Pitch); // Pitch
        ons.write(50); // Yaw (not yet implemented so I send 50) maybe this is the problem
        ons.write(125); //Aux1


EDIT: The motors arm once, even if the bluetooth is not connected(or the phone)

Deepu
Posts: 7
Joined: Mon May 07, 2012 4:08 am

Re: Bluetooth + Multiwii

Post by Deepu »

@Theelectronicguy: I'm working on the same mate any luck so far in getting it to work.

Post Reply