Bluetooth + Multiwii
-
- Posts: 49
- Joined: Tue Dec 06, 2011 3:12 am
Bluetooth + Multiwii
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
Thanks
Re: Bluetooth + Multiwii
No.
Look under the 'K' command inside serialCom()
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
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
Re: Bluetooth + Multiwii
which android app do you use for sending, please?
Re: Bluetooth + Multiwii
I'm guessing hes writing his own
-
- Posts: 49
- Joined: Tue Dec 06, 2011 3:12 am
Re: Bluetooth + Multiwii
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/
http://fr.appbrain.com/app/multiwii-bt- ... s.bicopter
http://www.amarino-toolkit.net/
-
- Posts: 49
- Joined: Tue Dec 06, 2011 3:12 am
Re: Bluetooth + Multiwii
Also, thanks for the quick reply !
-
- Posts: 49
- Joined: Tue Dec 06, 2011 3:12 am
Re: Bluetooth + Multiwii
Man I was about to start programming when I realized I dont know what AUX1 is?!?!?
Re: Bluetooth + Multiwii
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.
-
- Posts: 49
- Joined: Tue Dec 06, 2011 3:12 am
Re: Bluetooth + Multiwii
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:
EDIT: The motors arm once, even if the bluetooth is not connected(or the phone)
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)
Re: Bluetooth + Multiwii
@Theelectronicguy: I'm working on the same mate any luck so far in getting it to work.