'this generates a variable frequency like the 555 circuit
'Rctime circuit goes to pin 7
'speaker goes to pin 9
'{$STAMP BS2}
bytevar VAR word
potvar VAR word
checkpot:

HIGH 1

PAUSE 1

RCTIME 7, 1, potvar
byteVar = (potvar/1000) * 255

'FREQOUT pin, time, frequency
FREQOUT 9, 5, potvar

GOTO checkpot