dazzan Posted March 23, 2006 Report Share Posted March 23, 2006 Hi Pete I would like to use the leds on the GFT8 with GFDisplay for indicating that Nav , strobe, logo , taxi, wing, recognition, beacon, landing lights are on. I think i have to use offset 0D0C. To program the buttons I have used the toggle navlights (for example) in FSUIPC. In GFdisplay I do not know how I could manage to get the appropriate led to work when a button is on. [GFT8.0] L0=XD0C ????? (landing lights) L1=XD0C ????? (nav lights) L2=XD0C ????? (taxi lights) and so on Thanks Link to comment Share on other sites More sharing options...
Pete Dowson Posted March 23, 2006 Report Share Posted March 23, 2006 I would like to use the leds on the GFT8 with GFDisplay for indicating that Nav , strobe, logo , taxi, wing, recognition, beacon, landing lights are on. I think i have to use offset 0D0C. In GFdisplay I do not know how I could manage to get the appropriate led to work when a button is on. In 0D0C each light switch is a separate bit, so all you need to to is make the LED conditional on that bit being non-zero. For example, the Taxi lights are bit 3 (meaning 2^3 or 2 x 2 x 2 = 8), or in hexadecimal X0008. For seeing which bits are set, hexadecimal numbers are simpler than the decimal ones we use in everyday life, Take a 16-bit binary number (only 1's and 0's) like 0101101011000011 Which in decimal is 23,235! In hexadecimal you simply divide the binary bits into groups of 4: 0101 1010 1100 0011 and assign a single character to each group: 5AC3 The characters assigned are: 0 = 0000 1 = 0001 2 = 0010 3 = 0011 4 = 0100 5 = 0101 6 = 0110 7 = 0111 8 = 1000 9 = 1001 A = 1010 B = 1011 C = 1100 D = 1101 E = 1110 F = 1111 In the case of the light switches, the bit numbers 0-15 simply mean how far from the bottom bit (the 1 bit or 0001 in hex) they are. So bit 3, for example, is three up, so in binary is 0000000000001000, or in hex 0008 (from the list above). In GFdisplay the offset therefore is X0D0C, as you know, and the "Mask" for the taxi light bit is M0008. Thus your line to control the taxi light bit is L2=X0D0C M0008 Okay? I'm sure you can now work out all the rest for yourself. Regards, Pete Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now