Arduino based LDR volume and source selection controller

I don't get these LDRs - I played a bit with them, driving them directly with analogWrite on pwm ports and RC network. They are usable up to 2K, as depicted in datasheet. After that, they are going totally crazy - change of 20mV at Vf=455mV results in 6K and more resistance jumps. How is lightspeed and this here attenuator working emulating pots larger than 10K? Or are they not?
 
Probably not:

Arduino: 1.6.8 (Windows 8.1), Board: "Arduino Nano, ATmega328"

VxD_optical_volume.ino:33:61: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

char* inputName[INPUTCOUNT] = { "DAC IN", "CD IN", "AUX IN" }; //** each name maximum 9 characters. There must be exactly INPUTCOUNT names in the list.

^

VxD_optical_volume\VxD_optical_volume.ino:33:61: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

VxD_optical_volume\VxD_optical_volume.ino:33:61: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

VxD_optical_volume\VxD_optical_volume.ino: In function 'byte doCalibration()':

VxD_optical_volume:399: error: 'setLCDMaxLight' was not declared in this scope

setLCDMaxLight();

^

VxD_optical_volume:420: error: 'printTick' was not declared in this scope

printTick();

^

VxD_optical_volume:634: error: 'printBar' was not declared in this scope

printBar(percent);

^

VxD_optical_volume:883: error: 'printBar' was not declared in this scope

printBar(percent);

^

VxD_optical_volume\VxD_optical_volume.ino: In function 'void setMute(byte)':

VxD_optical_volume:1087: error: 'printTwoNumber' was not declared in this scope

printTwoNumber(VOLCOL, volume);

^

VxD_optical_volume\VxD_optical_volume.ino: In function 'void setInput()':

VxD_optical_volume:1097: error: 'lcd_print' was not declared in this scope

lcd_print(inputName[chan_in], 9);

^

VxD_optical_volume\VxD_optical_volume.ino: In function 'void setVolume(byte)':

VxD_optical_volume:1702: error: 'printTwoNumber' was not declared in this scope

printTwoNumber(VOLCOL, vol);

^

VxD_optical_volume\VxD_optical_volume.ino: In function 'void setup()':

VxD_optical_volume:1753: error: 'sinMap' was not declared in this scope

analogWrite(PIN_LCDBRI, sinMap(i, 0, LCDBRI_MAX, 0));

^

VxD_optical_volume:1759: error: 'defineCustomChar' was not declared in this scope

defineCustomChar();

^

VxD_optical_volume:1761: error: 'setLCDMaxLight' was not declared in this scope

setLCDMaxLight();

^

VxD_optical_volume\VxD_optical_volume.ino: In function 'void loop()':

VxD_optical_volume:1851: error: 'startLCDFadeIn' was not declared in this scope

startLCDFadeIn();

^

VxD_optical_volume:1907: error: 'startLCDFadeIn' was not declared in this scope

startLCDFadeIn();

^

VxD_optical_volume.ino:1945:22: warning: division by zero [-Wdiv-by-zero]

chan_out %= OUTPUTCOUNT;

^

VxD_optical_volume:1977: error: 'startLCDFadeIn' was not declared in this scope

startLCDFadeIn();

^

VxD_optical_volume:2069: error: 'sinMap' was not declared in this scope

LCDcurrentPW = sinMap(mil_delta, 0, TIME_LCDFADEIN * 1000, LCDinitialPW);

^

VxD_optical_volume:2073: error: 'setLCDMaxLight' was not declared in this scope

setLCDMaxLight();

^

VxD_optical_volume:2081: error: 'sinMap' was not declared in this scope

LCDcurrentPW = sinMap(mil_delta, TIME_LCDFADEOUT * 1000, 0, LCDBRI_MIN);

^

VxD_optical_volume:2085: error: 'setLCDMinLight' was not declared in this scope

setLCDMinLight();

^

VxD_optical_volume:2091: error: 'startLCDFadeOut' was not declared in this scope

startLCDFadeOut();

^

exit status 1
'setLCDMaxLight' was not declared in this scope

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
 
Now I am down to bunch of these:

..\VxD_optical_volume\screen.ino:177:144: warning: narrowing conversion of '255' from 'int' to 'char' inside { } [-Wnarrowing]

char bn4[] = { 4, 3, 3, 7, 3, 3, B, 3, B, 3, 3, 3, 4, 3, 3, 7, A, A, A, B, 4, 3, 3, 7, 4, 3, 3, 7, A, A, B, A, 4, 3, 3, 7, 4, 3, 3, 7 };

^

..\Arduino\VxD_optical_volume\screen.ino:177:144: warning: narrowing conversion of '255' from 'int' to 'char' inside { } [-Wnarrowing]
 
Nice alternative to lcd, playing with 17eur OLED.

a714c15e8724d1345de1252f6a28e02c.jpg


Sent from my Nexus 6 using Tapatalk
 
Very minor bug - when the volume is set to 00 (but not in mute mode) and the 'MENU' button is pressed on the remote then the volume digits disappear. They return when the volume is incremented.

This can be fixed by modifying: void setVolume

...by moving the printTwoNumber(VOLCOL, vol); statement to outside of the second 'if' block to force a refresh regardless of the value of the vol variable.

Chris