SCARAB AVATAR multiwii code.
SCARAB AVATAR multiwii code.
Hi all,
Someone could tell me the modification to be done for that configuration ?
How to add a motor to the BI configuration ?
or
How to add two servo to the TRI configuration ?
My board is a méga (AIO PRO V1). thanks by advance.
Someone could tell me the modification to be done for that configuration ?
How to add a motor to the BI configuration ?
or
How to add two servo to the TRI configuration ?
My board is a méga (AIO PRO V1). thanks by advance.
Re: SCARAB AVATAR multiwii code.
In def.h increase motors to 3.
In otput.ino
Add motor[2] = PIDMIX(0, 1, 0); //Extra
Code: Select all
#elif defined(BI)
#define NUMBER_MOTOR 2
#define PRI_SERVO_FROM 5 // use servo from 5 to 6
#define PRI_SERVO_TO 6
In otput.ino
Add motor[2] = PIDMIX(0, 1, 0); //Extra
Code: Select all
#ifdef BI
motor[0] = PIDMIX(+1, 0, 0); //LEFT
motor[1] = PIDMIX(-1, 0, 0); //RIGHT
servo[4] = constrain(1500 + (YAW_DIRECTION * axisPID[YAW]) + axisPID[PITCH], 1020, 2000); //LEFT
servo[5] = constrain(1500 + (YAW_DIRECTION * axisPID[YAW]) - axisPID[PITCH], 1020, 2000); //RIGHT
#endif
Re: SCARAB AVATAR multiwii code.
PatrikE i ´ve finally understand That scarab avatar is using the TRI configuration.
So i define SERVO_6_PINMODE pinMode(7,OUTPUT); // to command m'y second servo
And i add for the high PORTE |= 1<<5; and PORTE &= ~(1<<5); for low
Problem output 7 doesn t work with the servo ???? Why ????,
So i define SERVO_6_PINMODE pinMode(7,OUTPUT); // to command m'y second servo
And i add for the high PORTE |= 1<<5; and PORTE &= ~(1<<5); for low
Problem output 7 doesn t work with the servo ???? Why ????,
Re: SCARAB AVATAR multiwii code.
Its work Now ! I understand Now That digital pin 7 of the board is PH4
Everything is based on arduino board !!!!! Digital pin 2 is PE4 !!!!!! Yeah im pround !!!!
Everything is based on arduino board !!!!! Digital pin 2 is PE4 !!!!!! Yeah im pround !!!!
Re: SCARAB AVATAR multiwii code.
It seems like it's a TRIcopter with 2 yaw servos on the front arms.
Easiest would be to just use a Y-servocable.
Mega and 328 based boards use different pins for servos.
Easiest would be to just use a Y-servocable.
Mega and 328 based boards use different pins for servos.
Re: SCARAB AVATAR multiwii code.
Yes its easy but you need to found a Y cable
you can write it like that too :
#define SERVO_6_PINMODE pinMode(2,OUTPUT);pinMode(7,OUTPUT);
#define SERVO_6_PIN_HIGH PORTE |= 1<<4;PORTH |= 1<<4;
#define SERVO_6_PIN_LOW PORTE &= ~(1<<4);PORTH &= ~(1<<4);
but you need to know the corresponding between Digital pin and Atmega 2560 PORT
digital PIN 1 is PE1
digital PIN 2 is PE4
digital PIN 3 is PE5
digital PIN 4 is PG5
digital PIN 5 is PE3
digital PIN 6 is PH3
and so and.... it's the PinMap2560 that i've found on arduino web page.
you can write it like that too :
#define SERVO_6_PINMODE pinMode(2,OUTPUT);pinMode(7,OUTPUT);
#define SERVO_6_PIN_HIGH PORTE |= 1<<4;PORTH |= 1<<4;
#define SERVO_6_PIN_LOW PORTE &= ~(1<<4);PORTH &= ~(1<<4);
but you need to know the corresponding between Digital pin and Atmega 2560 PORT
digital PIN 1 is PE1
digital PIN 2 is PE4
digital PIN 3 is PE5
digital PIN 4 is PG5
digital PIN 5 is PE3
digital PIN 6 is PH3
and so and.... it's the PinMap2560 that i've found on arduino web page.
Re: SCARAB AVATAR multiwii code.
Or do like other people do...
Change to the servos you want to use.
Then the code in the project Fix all the rest...
/Patrik
Code: Select all
#elif defined(TRI)
#define NUMBER_MOTOR 3
#define PRI_SERVO_FROM 6 // use only servo 6
#define PRI_SERVO_TO 6
Change to the servos you want to use.
Then the code in the project Fix all the rest...
/Patrik
Re: SCARAB AVATAR multiwii code.
Yes right ! But you Still need to change SERVO_7_PINMODE who is affected to pin 5 (already reserved for front right motor).
Even SERVO_8_PINMODE who is pin 3 (rear motor already affected).
Even SERVO_8_PINMODE who is pin 3 (rear motor already affected).
Re: SCARAB AVATAR multiwii code.
the video of the first flight : i still need to tune the PID but it's fly well.
http://www.facebook.com/photo.php?v=102 ... 8537054837
http://www.facebook.com/photo.php?v=102 ... 8537054837
Re: SCARAB AVATAR multiwii code.
Mega and 328 based boards use different pins for servos.
[/quote]
My question is that:the specified PIN can be configured as the motor and Servo at the same time ?
Thanks.
[/quote]
My question is that:the specified PIN can be configured as the motor and Servo at the same time ?
Thanks.