View Single Post
Old Mar 17, 2012, 02:39 AM
aBUGSnightmare is offline
Find More Posts by aBUGSnightmare
Registered User
Joined Jul 2011
188 Posts
DIVIDE et IMPERA! Rev2 - Details

@Paul: Here we go!


The image shows you the DIVIDE et IMPERA! Rev2 functional blocks description.


RGB LED-stripes connections for flight mode/LiPo-Alarm signalization.

And here's the code for using the LED strings for flight mode signalization. The solder jumper JP9 needs to be connected to 2-3 (LED-OUT controlled by CAM-T; also printed on the boards silkscreen for reference).

1. Include CamPinPWM.ino to your sketch. You can select the displayed color via the variable 'duty_time'. Look at the example and try it out.

2.) Open your sketch and look for the setup()-routine
...
void setup() {
SerialOpen(0,115200);
LEDPIN_PINMODE;
POWERPIN_PINMODE;
BUZZERPIN_PINMODE;
STABLEPIN_PINMODE;
POWERPIN_OFF;
initOutput();
readEEPROM();
checkFirstTime();
configureReceiver();
initSensors();
previousTime = micros();
#if defined(GIMBAL)
..


and change this to:
...
void setup() {
SerialOpen(0,115200);
LEDPIN_PINMODE;
POWERPIN_PINMODE;
BUZZERPIN_PINMODE;
STABLEPIN_PINMODE;
POWERPIN_OFF;
initOutput();
readEEPROM();
checkFirstTime();
configureReceiver();
initSensors();
//=========================== PWM FLIGHT MODE SIGNALIZATION
initCamPinPWM();
//================================================== ====END
previousTime = micros();
#if defined(GIMBAL)
..


3.) navigate to the main-loop (in the same file) and look for
...
for(i=0;i<CHECKBOXITEMS;i++) {
rcOptions[i] = (
( (rcData[AUX1]<1300) | (1300<rcData[AUX1] && rcData[AUX1]<1700)<<1 | (rcData[AUX1]>1700)<<2
|(rcData[AUX2]<1300)<<3 | (1300<rcData[AUX2] && rcData[AUX2]<1700)<<4 | (rcData[AUX2]>1700)<<5) & activate1[i]
)||(
( (rcData[AUX3]<1300) | (1300<rcData[AUX3] && rcData[AUX3]<1700)<<1 | (rcData[AUX3]>1700)<<2
|(rcData[AUX4]<1300)<<3 | (1300<rcData[AUX4] && rcData[AUX4]<1700)<<4 | (rcData[AUX4]>1700)<<5) & activate2[i]);
}
...



change this to:
--
for(i=0;i<CHECKBOXITEMS;i++) {
rcOptions[i] = (
( (rcData[AUX1]<1300) | (1300<rcData[AUX1] && rcData[AUX1]<1700)<<1 | (rcData[AUX1]>1700)<<2
|(rcData[AUX2]<1300)<<3 | (1300<rcData[AUX2] && rcData[AUX2]<1700)<<4 | (rcData[AUX2]>1700)<<5) & activate1[i]
)||(
( (rcData[AUX3]<1300) | (1300<rcData[AUX3] && rcData[AUX3]<1700)<<1 | (rcData[AUX3]>1700)<<2
|(rcData[AUX4]<1300)<<3 | (1300<rcData[AUX4] && rcData[AUX4]<1700)<<4 | (rcData[AUX4]>1700)<<5) & activate2[i]);
}

//--------------------------------------- PWM FLIGHT MODE SIGNALIZATION
setDutyTime();
//------------------------------------------------------------------END
..


4.) Compile/upload it and your done!

Have fun!
aBUGSworstnightmare
aBUGSnightmare is offline Find More Posts by aBUGSnightmare
Last edited by aBUGSnightmare; Mar 17, 2012 at 01:51 PM.
Reply With Quote