What range of frequencies are you aiming to generate. I see from your SOUND statements that it would equal notes 50 to 113 but I don't know what that translates to in actual frequency (and are those numbers critical?
Like Art says, all the SOUND command is doing is toggling a pin. You can do that too and you make the ADC do the conversion while waiting to flip the pin. Something like this perhaps (not tested):
/Henrik.Code:SomeValue CON 250 SomeConstant CON 4 Main: IF Trigger THEN SPK = 1 ' Set pin high GO_DONE = 1 WHILE GO_DONE : WEND ' AD conversion will always take the same amount of time PAUSEUS SomeValue + (ADRES * SomeConstant) SPK = 0 GO_DONE = 1 WHILE GO_DONE : WEND ' AD conversion will always take the same amount of time PAUSEUS SomeValue + (ADRES * SomeConstant) ENDIF Goto Main




Bookmarks