Pages: [1]   Go Down
Author Topic: What's wrong with this code?  (Read 312 times)
0 Members and 1 Guest are viewing this topic.
Portugal
Offline Offline
Jr. Member
**
Karma: 0
Posts: 62
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey mates,

I don't have any clue why this code does not work right.

If "minute" is 36, why "brightnessFactor" is "1"?

By the way... no matter what the minute is, brightnessFactor is always "1"? brightnessFactor should be 0.82 when "minute" is 36.

Pardon my french, but WTF?!

smiley Thanks mates!

« Last Edit: March 23, 2013, 03:53:33 pm by KenshinPT » Logged

Offline Offline
God Member
*****
Karma: 17
Posts: 721
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You've got a line there that says brightnessFactor = a whole bunch of integer math.  Integer math is only going to give inter gets, it will never give you 0.82 or any other decimal number.

Make those constants floats like 1.0 and 2.0 instead of just 1 and 2 and see what happens.
Logged

Portugal
Offline Offline
Jr. Member
**
Karma: 0
Posts: 62
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You've got a line there that says brightnessFactor = a whole bunch of integer math.  Integer math is only going to give inter gets, it will never give you 0.82 or any other decimal number.

Make those constants floats like 1.0 and 2.0 instead of just 1 and 2 and see what happens.

Thank you so much mate smiley Problem solved.

This is why I hate coding! ^^!

Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 290
Posts: 25732
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Please read the sticky threads.
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Pages: [1]   Go Up
Jump to: