PilotLamp pointers?
PilotLamp pointers?
I'm looking at plugging an XAircraft PilotLamp into my board. I noticed some code that seems to indicate this is supported in some way (at least in MultiWii_shared).PilotLamp has three LEDs (Red Green and Blue) and a buzzer, but the code doesn't appear to support the buzzer.
What pin(s) should I hook the PilotLamp up to? Has anyone already done this? Can someone point to some tutorial or information at all?
What pin(s) should I hook the PilotLamp up to? Has anyone already done this? Can someone point to some tutorial or information at all?
Re: PilotLamp pointers?
The buzzer is supported too!!!!!!
Ask my wife
Ask my wife

Re: PilotLamp pointers?
Ha nice one. Maybe thats a way to get my wide interested too... She hates copters
- jevermeister
- Posts: 708
- Joined: Wed Jul 20, 2011 8:56 am
- Contact:
Re: PilotLamp pointers?
All normal buzzer sounds are rerouted to pilotlamp if you enable pilotlqmi in config.m.
be careful NOT to connect the lamp to the buzzerpin if the pilotlp is not enabled. it may damage the buzzer.
please send feedback if everything is working.
nils
be careful NOT to connect the lamp to the buzzerpin if the pilotlp is not enabled. it may damage the buzzer.
please send feedback if everything is working.
nils
Re: PilotLamp pointers?
by the way. Is there a way to use the LED with different funktions?
Perhaps as landig lamp?
Perhaps as landig lamp?
- jevermeister
- Posts: 708
- Joined: Wed Jul 20, 2011 8:56 am
- Contact:
Re: PilotLamp pointers?
you can program whtaever you want
. what do you have in mind?
Pleas join #multiwii on freenode to discuss things like this.

Pleas join #multiwii on freenode to discuss things like this.
Re: PilotLamp pointers?
cGiesen wrote:by the way. Is there a way to use the LED with different funktions?
Perhaps as landig lamp?
I did exactly this. I added an Ultrasonic sensor and modified the GPS alert section in pilotlamp (blue light) to be used as a "low altitude" warning (well, its basically same as landing light), and I added a beep code also so it will beep when altitude is low.
Re: PilotLamp pointers?
Thanks all for the answers! Looks like it's exactly what I'm looking for 

Re: PilotLamp pointers?
Hmm. Well, I enabled PILOTLAMP, plugged my PilotLamp into the buzzer pin (D8), and.... nothing. Am I doing something wrong? How do I diagnose this type of problem? Does the fact that I'm using a PPM receiver have any impact?
- jevermeister
- Posts: 708
- Joined: Wed Jul 20, 2011 8:56 am
- Contact:
Re: PilotLamp pointers?
you have to connect 5v and gnd too
Re: PilotLamp pointers?
Looks like, for starters, the BUZ pin on this board is connected to D9, and not D8 for some reason (design error?). I can't find where D8 comes out. Is there some way to configure which pin to use for BUZ within the multiwii code?
- jevermeister
- Posts: 708
- Joined: Wed Jul 20, 2011 8:56 am
- Contact:
Re: PilotLamp pointers?
in the last devs there is an option to reroute the outputs. but it not hard to do it in the standard 2.1 if you look into the def.h
but if it is a board specific thing this should be made into a define and comitted into the shared trunk.
but if it is a board specific thing this should be made into a define and comitted into the shared trunk.
PilotLamp pointers?
Is there any chance to move the pilotLamp to pin46 on megaboard i don't need the camtrigger but my board Pilot Lamp is not working on TX1 or D8
Im using a HK mega board at the moment testet with an Cirrus SE on D8 the Pilotlamp worked fine.
Thx Frank
Im using a HK mega board at the moment testet with an Cirrus SE on D8 the Pilotlamp worked fine.
Thx Frank
- jevermeister
- Posts: 708
- Joined: Wed Jul 20, 2011 8:56 am
- Contact:
Re: PilotLamp pointers?
you can remap the pin by yourself. there is a section for that in config.h. we can not move this pin and break everyone's config.
PilotLamp pointers?
Sorry, i was misunderstood, I did not not want you to change the default files 
To be more precise will i face any trouble then with interupts or will i be free in the choice which Output pin i use ?
An will a change in config h be enough to asign the pin ?
I'm new to this
Thx Frank

To be more precise will i face any trouble then with interupts or will i be free in the choice which Output pin i use ?
An will a change in config h be enough to asign the pin ?
I'm new to this
Thx Frank
Re: PilotLamp pointers?
One more Question,
Would this be the right code then ?
#define BUZZERPIN_PINMODE pinMode (D46, OUTPUT); // use D46 instead of d8 / URF
#define BUZZERPIN_ON PORTC |= 1<<2 //PORTB |= 1;
#define BUZZERPIN_OFF PORTC &= ~(1<<2); //PORTB &= ~1;
thx Frank
Would this be the right code then ?
#define BUZZERPIN_PINMODE pinMode (D46, OUTPUT); // use D46 instead of d8 / URF
#define BUZZERPIN_ON PORTC |= 1<<2 //PORTB |= 1;
#define BUZZERPIN_OFF PORTC &= ~(1<<2); //PORTB &= ~1;
thx Frank
- jevermeister
- Posts: 708
- Joined: Wed Jul 20, 2011 8:56 am
- Contact:
Re: PilotLamp pointers?
Hi.
Sorry. Not sure if it works.You should ask doughboy or copterrichie or eosbandi. They know a lot more about interrupts than me.
But you can always try. Code seems okay though.
Nils
Sorry. Not sure if it works.You should ask doughboy or copterrichie or eosbandi. They know a lot more about interrupts than me.
But you can always try. Code seems okay though.
Nils
Re: PilotLamp pointers?
Urbasik wrote: #define BUZZERPIN_PINMODE pinMode (D46, OUTPUT); // use D46 instead of d8 / URF
#define BUZZERPIN_ON PORTC |= 1<<2 //PORTB |= 1;
#define BUZZERPIN_OFF PORTC &= ~(1<<2); //PORTB &= ~1;
Frank,
you need not change def.h. With newer versions you find in config.h
Code: Select all
//#define OVERRIDE_BUZZERPIN_PINMODE pinMode (A2, OUTPUT); // use A2 instead of d8
//#define OVERRIDE_BUZZERPIN_ON PORTC |= 1<<2 //PORTB |= 1;
//#define OVERRIDE_BUZZERPIN_OFF PORTC &= ~(1<<2); //PORTB &= ~1;
you can set to desired values. Saves you from fiddling with def.h and does what you want. Check at end of def.h.
Re: PilotLamp pointers?
Thx a lot,
the code i posted was copied from DEV r1240´s Config.h
exactly tih section:
So I guess I was goin the right direction.
/**************************************************************************************/
/******** override default pin assignments ********************/
/**************************************************************************************/
/* only enable any of this if you must change the default pin assignment, e.g. your board does not have a specific pin */
/* you may need to change PINx and PORTx plus shift # according to the desired pin! */
//#define V_BATPIN A0 // instead of A3 // Analog PIN 3
//#define LEDPIN_PINMODE pinMode (A1, OUTPUT); // use A1 instead of d13
//#define LEDPIN_TOGGLE PINC |= 1<<1; // PINB |= 1<<5; //switch LEDPIN state (digital PIN 13)
//#define LEDPIN_OFF PORTC &= ~(1<<1); // PORTB &= ~(1<<5);
//#define LEDPIN_ON PORTC |= 1<<1; // was PORTB |= (1<<5);
#define BUZZERPIN_PINMODE pinMode (D46, OUTPUT); // use D46 instead of d8 / URF
#define BUZZERPIN_ON PORTC |= 1<<2 //PORTB |= 1;
#define BUZZERPIN_OFF PORTC &= ~(1<<2); //PORTB &= ~1;
I guess there is nothing else neccesarry then ?
I´ll try it this evening then.
regards Frank
the code i posted was copied from DEV r1240´s Config.h
exactly tih section:
So I guess I was goin the right direction.
/**************************************************************************************/
/******** override default pin assignments ********************/
/**************************************************************************************/
/* only enable any of this if you must change the default pin assignment, e.g. your board does not have a specific pin */
/* you may need to change PINx and PORTx plus shift # according to the desired pin! */
//#define V_BATPIN A0 // instead of A3 // Analog PIN 3
//#define LEDPIN_PINMODE pinMode (A1, OUTPUT); // use A1 instead of d13
//#define LEDPIN_TOGGLE PINC |= 1<<1; // PINB |= 1<<5; //switch LEDPIN state (digital PIN 13)
//#define LEDPIN_OFF PORTC &= ~(1<<1); // PORTB &= ~(1<<5);
//#define LEDPIN_ON PORTC |= 1<<1; // was PORTB |= (1<<5);
#define BUZZERPIN_PINMODE pinMode (D46, OUTPUT); // use D46 instead of d8 / URF
#define BUZZERPIN_ON PORTC |= 1<<2 //PORTB |= 1;
#define BUZZERPIN_OFF PORTC &= ~(1<<2); //PORTB &= ~1;
I guess there is nothing else neccesarry then ?
I´ll try it this evening then.
regards Frank
Re: PilotLamp pointers?
sorry,
the names have to be changed to start with OVERRIDE_ ; else the override will not happen.
I fixed this in latest rev only.
the names have to be changed to start with OVERRIDE_ ; else the override will not happen.
I fixed this in latest rev only.
Re: PilotLamp pointers?
#define OVERRIDE_BUZZERPIN_PINMODE pinMode (D46, OUTPUT); // use D46 instead of d8 / URF
#define OVERRIDE_BUZZERPIN_ON PORTC |= 1<<2 //PORTB |= 1;
#define OVERRIDE_BUZZERPIN_OFF PORTC &= ~(1<<2); //PORTB &= ~1;
So this will be the right code then i guess
Will this also work for the Powerpin ?
thx for your help
brg
Frank
#define OVERRIDE_BUZZERPIN_ON PORTC |= 1<<2 //PORTB |= 1;
#define OVERRIDE_BUZZERPIN_OFF PORTC &= ~(1<<2); //PORTB &= ~1;
So this will be the right code then i guess
Will this also work for the Powerpin ?
thx for your help
brg
Frank
Re: PilotLamp pointers?
For sme reason it does not work,
the Pilot lamp works on another boerd but not on my Megaboard.
Tried A15,D46,D44 ans so on
Evn changing direkt in Dev.h does not work.
Does anybody have it working with the HK Mega Board, the read one ?
Thanks Anyway
Frank
the Pilot lamp works on another boerd but not on my Megaboard.
Tried A15,D46,D44 ans so on
Evn changing direkt in Dev.h does not work.
Does anybody have it working with the HK Mega Board, the read one ?
Thanks Anyway
Frank
- jevermeister
- Posts: 708
- Joined: Wed Jul 20, 2011 8:56 am
- Contact:
Re: PilotLamp pointers?
Is the routing correct?Try to check with a multimeter from input pin to mega chip pin
Re: PilotLamp pointers?
I´ll try that an report, Wouldn´t wonder if there is something wrong.
Is there a pinout somewhere ?
Guess I´ll find something
Is there a pinout somewhere ?
Guess I´ll find something
- jevermeister
- Posts: 708
- Joined: Wed Jul 20, 2011 8:56 am
- Contact:
Re: PilotLamp pointers?
threre are schematics for 2560.look for the alignment and measure.
I recently heard of boards with wrong pin description
good luck
I recently heard of boards with wrong pin description
good luck
PilotLamp pointers?
Hi, followed the routes and measured
First pin i knew they were working
A8-89
D2-6
D3-7
D5-5
D6-14
Now the pins which are not working
D8-17
D9-18
D44-40
D45-39
D46-38
Could it be that the routing onnthe board is wrong ?
Thx for your help.
Frank
First pin i knew they were working
A8-89
D2-6
D3-7
D5-5
D6-14
Now the pins which are not working
D8-17
D9-18
D44-40
D45-39
D46-38
Could it be that the routing onnthe board is wrong ?
Thx for your help.
Frank
Re: PilotLamp pointers?
Urbasik wrote:Hi, followed the routes and measured
First pin i knew they were working
A8-89
D2-6
D3-7
D5-5
D6-14
Now the pins which are not working
D8-17
D9-18
D44-40
D45-39
D46-38
Could it be that the routing onnthe board is wrong ?
Thx for your help.
Frank
Hi Frank
How's it going with the routing ?
Im going to do exactly the same thing as u. (on the same Red "HK MultiWii PRO w/MTK GPS Module" Mega2560 board ) I want landing light to turn on when im near 50cm from ground on D8. But im using the sonar to messure this (on pin D9 and D10) and i dont see how i use the D8 for turning on the landinglights.
So if u found a way to do ur thing, i could use some of ur infomation to get a littel further.
Thx Tvixen
/Tvixen
Re: PilotLamp pointers?
Got it all figured out.
Here is the code for landinglights on HK MultiWii PRO w/MTK GPS Module" Mega2560 board. Pin D8.
offcourse you have to enable the sonar code in config.h (Sonar=pin D9 is trigger, D10 is Echo)
Dont mess with the "BUZZER" code, leave it as it is.
/Tvixen
Here is the code for landinglights on HK MultiWii PRO w/MTK GPS Module" Mega2560 board. Pin D8.
offcourse you have to enable the sonar code in config.h (Sonar=pin D9 is trigger, D10 is Echo)
Code: Select all
/******************************* Landing lights *********************************/
/* Landing lights
Use an output pin to control landing lights.
They can be switched automatically when used in conjunction with altitude data from a sonar unit. */
#define LANDING_LIGHTS_DDR DDRH
#define LANDING_LIGHTS_PORT PORTH
#define LANDING_LIGHTS_BIT PORTH5
// #define LANDING_LIGHTS_INVERT //inverterer lyset; activ =lights when over LANDING_LIGHTS_AUTO_ALTITUDE
/* altitude above ground (in cm) as reported by sonar */
#define LANDING_LIGHTS_AUTO_ALTITUDE 50 //Sætter lys på når den kommer under 50cm
Dont mess with the "BUZZER" code, leave it as it is.
/Tvixen