Pages: 1 2 [3] 4 5 6 ... 10
21
« Last post by NS-21 on May 25, 2023, 02:42:33 PM »
if i had a bigger printer i would do that one https://www.3dprintedtanks.com/is1en/
Greetings, dear! I have been jealous of your tank and print quality for a very long time, and what can I say? I'm doing KV-1! Scaled 1:10. I have a printer with a large print area, and I am printing a project (more precisely, it is already printed by 60%) from this respected author: https://www.printables.com/model/219806-tank-kv-1-rc-model-110This is an incredible model! P.S. I will also find an opportunity to buy from https://www.3dprintedtanks.com/ - the T-34 tank! Unfortunately, there are still difficulties in paying, but I will overcome this difficulty as well. And I'm also looking forward to when he makes a model of the IS-2 tank!
22
« Last post by Rongyos on May 25, 2023, 02:20:22 PM »
let's see if the effect looks good on the brake output first, because it will be the same effect on the Aux output.
Hi Luke, Thanks for your support  I think "we are almost there". The flickering works in the brake light but I think it only needs a "faderate", because now it changes the dim very fast. IDK if this helps but I found a code from somewhere with fadein fadeout (it might be useless but trying to "help"): int brightness = random(256);
// Fade in for (int fadeValue = 0; fadeValue <= brightness; fadeValue += 5) { analogWrite(ledPin, fadeValue); delay(10); }
// Fade out for (int fadeValue = brightness; fadeValue >= 0; fadeValue -= 5) { analogWrite(ledPin, fadeValue); delay(10); } Rongyos
23
« Last post by LukeZ on May 25, 2023, 10:10:19 AM »
I'm afraid I don't have a suggestion, the fact is I am not too experienced with sound circuits even though I designed one. Hopefully someone else will have a suggestion. I think this is definitely an application where it helps to have the components on a board and a DIY one with lots of wires will certainly be susceptible to interference.
24
« Last post by LukeZ on May 25, 2023, 10:07:35 AM »
Hi Rongyos, thanks once again for doing this test. I apologize I'm not able to work out these bugs on my end, I only have a couple TCB boards left to me and they are in a storage box on the other side of the world!
I think I know what was wrong with the brake light effect. I've made a new firmware, this time I'm just attaching it to this message and will wait to update the official one until we have all the problems worked out. Can you test once again with the brakelight and let me know how it looks?
As for the headlight pin, no, unfortunately, that is what I was saying earlier, it is not PWM compatible. It can only be turned on or off, and I agree with you, that effect does not look very good...
It should be possible to flicker the Aux output but let's see if the effect looks good on the brake output first, because it will be the same effect on the Aux output.
25
« Last post by Rongyos on May 25, 2023, 08:59:32 AM »
Hi Everybody!
Can you recommend a cheap RFI/EMI filter for my homebuilt sound card? In lower volumes I hear annoying buzz or high pitch noise and if I put my tx closer to the device a buzz going crazy. Maybe I need shielded cable for the speaker? Can I make it better with shielded cable?
Thanks Rongyos
26
« Last post by Rongyos on May 24, 2023, 02:14:34 PM »
The brake light is connected to an analog output which is how we are able to dim it for "running lights." If you set the "Brake Lights on When Stopped" option you will see that it uses a flickering effect similar to the candle effect you found. But when we are flickering the "running lights" I can't be sure what dim level the user specified, and to flicker a dim light it might not be very visible, so in that case I am flickering it only between off and the dim level.
[...] In the meantime, maybe you could attach a white led to the Brake lights, and select the "Brake Lights on When Stopped" option, and then at least let me know if that effect even looks very good?
Hi Luke, I attach a video how it looks. The brake light is on during enginestart sequence and no flickering on it (in the video it looks like it has but its just visual illusion, the blinking headlight effects the camera lens (beleive me pls  ) Is the Headlight pin is PWM compatible digital pin? (analogWrite = random(150)+170) How complicated will be to add this effect to AUX outputs if the brake light flickering will successful? It would be very good. Thanks Rongyos
27
« Last post by LukeZ on May 23, 2023, 08:06:48 AM »
Hi Rongyos, you're right, simply turning a light on and off doesn't make for a very realistic "flickering" effect. I haven't actually seen what it looks like, but I can imagine it is not very good.
Unfortunately, that is the only option we have for the headlights, which is connected to a "digital" output on the ATmega2560 chip. A "digital" output is one that can only have two states, either on or off. There are other pins on the ATmega2560 that are called "analog" outputs and those can be set to any level between off (0) and on (255). But these pins are limited in number and we have had to use them for other things.
The brake light is connected to an analog output which is how we are able to dim it for "running lights." If you set the "Brake Lights on When Stopped" option you will see that it uses a flickering effect similar to the candle effect you found. But when we are flickering the "running lights" I can't be sure what dim level the user specified, and to flicker a dim light it might not be very visible, so in that case I am flickering it only between off and the dim level.
Here is the code I have added which handles the flickering. There is more than this, but this is the important part:
// This effect takes place on engine startup if the user has selected the option to "Flicker Headlights on Engine Start" (Lights & IO tab of OP Config) // and if they have specified a "Transmission Engage Delay" (Driving tab of OP Config). The effect will last for the duration of the Transmission Engage Delay. // It applies to both the headlights and the brake/running lights, but only if they were already on before the effect begins. void FlickerLights() { static boolean flickerState; // Initialize if appropriate: if (HeadlightsFlickering == false && BrakeLightsFlickering == false) // They will both be false if we have not started the effect. { // They will both remain false if neither the headlights or brakelights are on, in which case we won't come back here. // Only flicker lights that are already on if (Light1State) HeadlightsFlickering = true; if (BrakeLightsActive || RunningLightsActive) BrakeLightsFlickering = true; if (HeadlightsFlickering || BrakeLightsFlickering) flickerState = false; // Initialize light state to false (which has the effect of starting the effect with "on") }
// Now perfrom the flickering if it has been enabled if (HeadlightsFlickering || BrakeLightsFlickering) { if (HeadlightsFlickering) { // The headlight output can not be dimmed, so we simply toggle it on and off. // We don't use the dedicated Light1Toggle function because that would also call the headlight sound, which we don't want, not to mention the possible debug message. flickerState ? digitalWrite(pin_Light1, LOW) : digitalWrite(pin_Light1, HIGH); } if (BrakeLightsFlickering) { // The brake light flickering effect will differ depending on whether we are flickering the running lights or the full brake lights. if (BrakeLightsActive) { // Here we vary the light between some lower and higher dim levels, it can go full off or full on, but also something in-between if (flickerState) analogWrite(pin_Brakelights, random(100)); // Dimmer - random value between 0 (off) and 100 (not even half brightness) else analogWrite(pin_Brakelights, random(75)+180); // Brighter - random value between 180 and 255 (full on) } else if (RunningLightsActive) { // Here we vary the light between full off and whatever the running lights dim level is flickerState ? digitalWrite(pin_Brakelights, LOW) : analogWrite(pin_Brakelights, RunningLightsDimLevel); } } // Toggle the flicker state, now it will match what we've just done above (which was the opposite of flickerState) flickerState = !flickerState; // Now set a timer to come back here after a random amount of time to continue the effect // We adjust the random delay so that the light "off" time is shorter than the light "on" time if (flickerState) FlickeringTimerID = timer.setTimeout(random(350)+60, FlickerLights); // On - random time between 60 and 410 mS else FlickeringTimerID = timer.setTimeout(random(210)+50, FlickerLights); // Off - random time between 50 and 260 mS } }
I think the only other option to improve the headlight flickering would be to use the Aux output for headlights instead. The Aux output uses an analog output and therefore could be flickered more realistically. Of course this would require even more changes, and also there is no headlight sound associated with the Aux output (although one could be created with Function Triggers assigned to the same switch).
I'm not sure if the added complexity would be worth it... I may consider it but I need to explore the code some more to remind myself what complications that would involve.
In the meantime, maybe you could attach a white led to the Brake lights, and select the "Brake Lights on When Stopped" option, and then at least let me know if that effect even looks very good?
28
« Last post by Rongyos on May 22, 2023, 04:14:46 PM »
Let me know how it goes.
Hi Luke, I thank you that you are dealing with it  Now the functions are working fine but a flickering does the led switch on and off randomly. Maybe thats why I wrote you a whole bunch of stupidity in the code. What about if you can change this? (stolen from candle effect arduino code): // Generate a random dimming value (0-255) int dimValue = [i]random(170) + 170[/i] [i]delay(random(150))[/i]; thanks Rongyos (the guineaPIG) 
29
« Last post by LukeZ on May 22, 2023, 03:30:06 PM »
Hi Rongyos, thank you very much for doing that test. In fact I see now there were multiple problems with the code I had written. It's always more complicated than it seems, and you're absolutely right, there are more dependencies than even I can remember!  But your test helped me find the problems. Also, in the version I posted yesterday, I hadn't implemented flickering for running lights, only brake lights. But I've added it now for both. And of course we don't want the headlight sound to be playing while we flicker the lights, so I've fixed that as well. Your 2 and 3 position switches should also hopefully now work correctly. I've posted an update to the firmware. I am keeping the same version name, but you can still download it and overwrite what you flashed yesterday. It's entirely possible there could still remain some bugs. I apologize I can't presently do any testing on my side, and I appreciate you being the guinea pig! Let me know how it goes.
30
« Last post by Rongyos on May 22, 2023, 08:19:17 AM »
I don't actually have a TCB to do any tests with, so I can't say exactly how good it will look. I'd appreciate if you could test it both to make sure it works as intended and also to let me know what you think of the flickering.
Hi Luke, First of all, thank you for your quick reply and support. I downloaded the new firmware and OP Config, managed to set up the build. I faced some bug / error: - Light toggle on/off function not working properly on headlights (see video) - its working well with toggle on + toggle off functions binded on 2 pos switch
- Start engine flickering not working with toggle on/off function at all
- Start engine flickering has some errors:
- a. only works with 2 pos function
- b. no lights at all during the start engine sequence
- c. random light sound played during the start engine sequence
maybe there are more dependencies than I thought  I attached a video for better understanding. The build is up and I am happy to test the upgrades  Rongyos
Pages: 1 2 [3] 4 5 6 ... 10
|