Greetings,

I am trying to get some sensible output from the resistance of a light dependent resistor to my SLCD. The following code give me a character that changes when I change the light however I am not sure what the character means other than it is from the ascii chart.

DEFINE OSC 4
PAUSE 2000
PitchCtrl CON 1 ' pitch control (RCTIME) input
Scale CON $0073 ' divider
tone VAR Word ' frequency output
Main:
HIGH PitchCtrl ' discharge cap
PAUSE 1 ' for 1 ms
RCTIME PitchCtrl, 1, tone ' read the light sensor
Serout 0, 6, [$fe, $1] ' Clear screen and move cursor to start of first line
Serout 0, 6, [$1b, $52, 1, tone] ' Output tone to SLCD.
pause 200
GOTO Main
END

Also how can I know what I am getting and then have an if statement that can do something based on the light reading. See second bit of code.

if tone < 10 Then
Serout 0, 6, [$fe, $1] ' Clear screen and move cursor to start of first line
Serout 0, 6, [$1b, $52, 1, "High"] ' Repeat the character B once.
Endif

if tone > 10 Then
Serout 0, 6, [$fe, $1] ' Clear screen and move cursor to start of first line
Serout 0, 6, [$1b, $52, 1, "Low"] ' Repeat the character B once.
Endif