Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Brightness Control in F-16. #113

Closed
Jacktherookie opened this issue Jul 22, 2022 · 10 comments
Closed

No Brightness Control in F-16. #113

Jacktherookie opened this issue Jul 22, 2022 · 10 comments

Comments

@Jacktherookie
Copy link

I'm trying to set flood light brightness according to position of the flood light knob.
But it seems flood light parts only emits 0 for off and 1 for on. Is there any options that I can control brightness of panel(or flood light itself)?
(By the way I'm using arduino not Flightpanel).

@WarLord211 WarLord211 transferred this issue from DCS-Skunkworks/DCSFlightpanels Jul 22, 2022
@WarLord211
Copy link
Member

its not Flightpanel related more the BIOS Side.
i uploaded a "fix" they are not lights anymore thea are floats -> gives an % state
same as A-10 and FA-18
uploaded to master

@Jacktherookie
Copy link
Author

Jacktherookie commented Jul 23, 2022

its not Flightpanel related more the BIOS Side. i uploaded a "fix" they are not lights anymore thea are floats -> gives an % state same as A-10 and FA-18 uploaded to master

Checking right now. I'll let you know results. Thanks.

@Jacktherookie
Copy link
Author

its not Flightpanel related more the BIOS Side. i uploaded a "fix" they are not lights anymore thea are floats -> gives an % state same as A-10 and FA-18 uploaded to master

Alright I just tested it - It's not working...

This is my Arduino Code

#define DCSBIOS_IRQ_SERIAL
#define flood_light 2

#include "DcsBios.h"

DcsBios::LED lightInstPnlFlood(0x4482, 0x0001, flood_light);

void setup() {
pinMode(flood_light, OUTPUT);
DcsBios::setup();
}

void loop() {
DcsBios::loop();
}

As I adjust the knob, LED brightness itselft does not change according to its value. It's just blinking when I adjust it.

And this is what I recorded while testing. This video shows what's actually happening.

https://youtu.be/-3KYrClhHWU

@WarLord211
Copy link
Member

the lights are not a "LED" anymore. the are "Servos" that gives you an % valve.
(was user requests for F-18 and A-10 so i decided to go also for the F16)

the code must changed to DcsBios::IntegerBuffer with some additions.
But how exactly that works i cant help you, since im more from the Plane as the arduino side.
if you come over to our discord there some folks which can help you. (link in readme)

@Jacktherookie
Copy link
Author

Thanks for reply. I already found that out like you said. Therefore I'm working out for it.

@Jacktherookie
Copy link
Author

the lights are not a "LED" anymore. the are "Servos" that gives you an % valve. (was user requests for F-18 and A-10 so i decided to go also for the F16)

the code must changed to DcsBios::IntegerBuffer with some additions. But how exactly that works i cant help you, since im more from the Plane as the arduino side. if you come over to our discord there some folks which can help you. (link in readme)

What's the range of the return value of Servo? isn't it from 0 to 65535?

@Jacktherookie
Copy link
Author

Jacktherookie commented Jul 23, 2022

My revised code for my flood light is

#define DCSBIOS_IRQ_SERIAL
#define flood_light 3

#include "DcsBios.h"

void onLightConslesFloodChange(unsigned int newValue) {
int val255 = map(newValue, 0, 65535, 0, 255); // translate newValue(Trying to change 16 bit to 8 bit for PWM) into new integer variable called "val255"
// int val255 = newValue * 255;
analogWrite(flood_light, val255); //Light the LEDs.
}
DcsBios::IntegerBuffer lightConslesFloodBuffer(0x4480, 0x8000, 15, onLightConslesFloodChange);

void setup() {
pinMode(flood_light, OUTPUT); //Pin 3 Output
DcsBios::setup();
}

void loop() {
DcsBios::loop();
}

But it seems not working for now. I'm trying to investigate further.

@talbotmcinnis
Copy link
Contributor

I can’t confirm the dcs-bios side, but once you have the address/offset correct, you won’t need to much code on the arduino side. The library already has a control that does what you want:

https://github.com/DCSFlightpanels/dcs-bios-arduino-library/wiki/Dimmer

@Jacktherookie
Copy link
Author

I can’t confirm the dcs-bios side, but once you have the address/offset correct, you won’t need to much code on the arduino side. The library already has a control that does what you want:

https://github.com/DCSFlightpanels/dcs-bios-arduino-library/wiki/Dimmer

Thanks for info. I've managed to work with Flood lights.

@WarLord211
Copy link
Member

Top!
can the issue closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants