11.07.2015 Views

PICBASIC PLUS LITE Manual - Profe Saul

PICBASIC PLUS LITE Manual - Profe Saul

PICBASIC PLUS LITE Manual - Profe Saul

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>PICBASIC</strong> <strong>PLUS</strong> Compiler5.69. SOUNDSyntax : SOUND Pin, [ Note,Duration {,Note,Duration...} ]Overview :Operators :Generates tone and/or white noise on the specified Pin. Pin is automaticallymade an output.Pin is a Port.Pin constant that specifies the output pin on thePICmicro.Note can be an 8-bit variable or constant. 0 is silence. Notes 1-127are tones. Notes 128-255 are white noise. Tones and white noisesare in ascending order (i.e. 1 and 128 are the lowest frequencies, 127and 255 are the highest). Note 1 is approx 78.74Hz and Note 127 isapprox 10,000Hz.Duration can be an 8-bit variable or constant that determines howlong the Note is played in approx 10ms increments.Example : SOUND PORTA.0 , [ 10 , 10 , Var , Var1 ]Notes :With the excellent I/O characteristics of the PICmicro, a speaker canbe driven through a capacitor directly form the pin of the PIC. Thevalue of the capacitor should be determined based on the frequenciesof interest and the speaker load. Piezo speakers can be driven directly.128Copyright Crownhill 2001

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!