Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unsigned int LDR = 512;
- float Calc1 = 0;
- float Calc2 = 0;
- float Calc3 = 0;
- float LogCalc = 0;
- //-----------------------
- void setup()
- {
- Serial.begin(9600);
- }
- //---------------------------------
- void loop()
- {
- Calc1 = map(LDR, 0, 1024 , 0, 470);
- Calc2 = (Calc1/470) * 10;
- LogCalc = log10(Calc2);
- Calc3 = 470 * LogCalc;
- Serial.println(Calc3);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement