Sorry for the stupid question... but I just can't figure this one out... I have value that increases exponentially ... and I want to decrease the value by the same amount in every step as when it was increasing... my code looks like this:
When increasing value, it gives me almost perfect linear output from pwm driven LED with exp_factor = 1.025. How do I decrease the fadetarget? I guess I shoud use logarithm, but how exactly?
Sorry, off-topic - I just LOVE Google Translate. I wanted to know what "Noglabaajam ieprieksheejo staavokli" meant. Google figured it was Latvian, AND suggested the correct spelling "Saglab?jam iepriekš?jo st?vokli" which it had translated to "Maintain the previous state" - which makes sense for the code shown.
Msquare:
Sorry, off-topic - I just LOVE Google Translate. I wanted to know what "Noglabaajam ieprieksheejo staavokli" meant. Google figured it was Latvian, AND suggested the correct spelling "Saglab?jam iepriekš?jo st?vokli" which it had translated to "Maintain the previous state" - which makes sense for the code shown.
(And now back to the problem )
Yes, I know I shouldn't use Latvian language in comments, but somehow forgetting it all the time +1 to google translate
On the contrary - I think programs should be written as nativly as possibly. In fact in C/C++ I could do a number of #defines so even "if", "else", "void" etc was translated to f.eks. Danish.
#define hvis if
#define intet void
intet loop() { hvis ( x == 3 ) x++ }
I have just been using English (my 3rd language) for so long now it just comes naturally to do english with the english programming keywords.
Now, when trying to get help in an international community it helps it is in english. But even that could be argued - if the variable names are nonsense to me, then I will only look at the structure and syntax and not be "fooled" into thinking it does something because of the function name or comment. On the other hand, the speed at which I understand the code will be much reduced, precisly because of that - I cant skip any sections because name/comments indicate the function to be trivial.
Arty:
... have value that increases exponentially ... and I want to decrease the value by the same amount in every step as when it was increasing.../quote]
I think programs should be written as nativly as possibly.
Native to the people who develop/maintain it I assume
yeah... it is not something I have a strong opinion on. If you're a developer in a large company then English is probably dictated anyhow (and necessary for multinational cooperation). In a one-person-hobby program, you write what makes sense to yourself. And everything in between correspondingly. (And now, back to the original programming problem )
If you're a developer in a large company then English is probably dictated
Definitely, in my current project we have at least 6 nationalities and we do 95% of the communication in English, only if there is a homogeneous group the mother language is spoken.
I think programs should be written as nativly as possibly.
Native to the people who develop/maintain it I assume
I have been thinking about it lots of times, but I can not come to the conclusion of what is the best way. To program in English, English + my native language or as natively as possible. Mainly its because of many non-ASCII characters in my native language (which you should not use anyway). But replacing characters like "Š" with "sh" or "Ž" with "zh" isn't truly native anymore. So I think I'll stick to English. This thread has gone somewhere far from the subject, and IMO with respect to the community should be locked
Thank you for sharing you thoughts on this though.