SOUND/de
(Difference between revisions)
(→(**COPIED FROM ENGLISH PAGE**) =) |
(→Remarks) |
||
Line 15: | Line 15: | ||
<span style="font-family: Arial;"> </span> | <span style="font-family: Arial;"> </span> | ||
− | = <span class="f_Header"> | + | = <span class="f_Header">Anmerkungen</span> = |
<div style="padding: 0px; margin: 0px 0px 0px 4px;"> | <div style="padding: 0px; margin: 0px 0px 0px 4px;"> | ||
{| width="581" cellspacing="0" cellpadding="1" border="1" style="border: 2px solid rgb(0, 0, 0); border-spacing: 0px; border-collapse: collapse;" | {| width="581" cellspacing="0" cellpadding="1" border="1" style="border: 2px solid rgb(0, 0, 0); border-spacing: 0px; border-collapse: collapse;" | ||
Line 23: | Line 23: | ||
| valign="top" width="100%" style="width: 494px; border: 1px solid rgb(0, 0, 0);" | | | valign="top" width="100%" style="width: 494px; border: 1px solid rgb(0, 0, 0);" | | ||
− | + | Beliebiger I/O-Pin wie zum Beispiel PORTB.0 etc. | |
|- style="vertical-align: top;" | |- style="vertical-align: top;" | ||
| valign="top" width="14%" style="width: 78px; border: 1px solid rgb(0, 0, 0);" | | | valign="top" width="14%" style="width: 78px; border: 1px solid rgb(0, 0, 0);" | | ||
− | + | duration | |
| valign="top" width="100%" style="width: 494px; border: 1px solid rgb(0, 0, 0);" | | | valign="top" width="100%" style="width: 494px; border: 1px solid rgb(0, 0, 0);" | | ||
− | + | Anzahl auszusendender Pulse. Byte, Integer/Word oder Konstante. | |
|- style="vertical-align: top;" | |- style="vertical-align: top;" | ||
| valign="top" width="14%" style="width: 78px; border: 1px solid rgb(0, 0, 0);" | | | valign="top" width="14%" style="width: 78px; border: 1px solid rgb(0, 0, 0);" | | ||
− | + | pulses | |
| valign="top" width="100%" style="width: 494px; border: 1px solid rgb(0, 0, 0);" | | | valign="top" width="100%" style="width: 494px; border: 1px solid rgb(0, 0, 0);" | | ||
− | + | Zeit, die der Pin pulsiert. | |
<span style="font-family: Arial;"> </span> | <span style="font-family: Arial;"> </span> | ||
− | + | Dieses ist der Wet für einen Schleifenzähler. | |
|} | |} | ||
Line 47: | Line 47: | ||
<span style="font-family: Arial;"> </span> | <span style="font-family: Arial;"> </span> | ||
− | + | Wenn ein Lautsprecher oder Piezo-Schallgeber an den Portpin angeschlossen wird dan kann man mit SOUND Töne erzeugen. | |
− | + | Der Portpin wird pulses mal an- und ausgeschaltet | |
− | + | Die Schleife wir duration mal ausgeführt. | |
<span style="font-family: Arial;"> </span> | <span style="font-family: Arial;"> </span> | ||
− | + | Der SOUND-Befehl ist nicht dafür gedacht, genaue Frequenzen zu erzeugen. Dafür sollte ein Timer benutzt werden. | |
| |
Revision as of 22:28, 1 March 2013
Contents |
Funktion
Gibt Pulse an einem Portpin aus. (Tonausgabe)
Syntax
SOUND pin, duration, pulses
Anmerkungen
Pin |
Beliebiger I/O-Pin wie zum Beispiel PORTB.0 etc. |
duration |
Anzahl auszusendender Pulse. Byte, Integer/Word oder Konstante. |
pulses |
Zeit, die der Pin pulsiert.
Dieses ist der Wet für einen Schleifenzähler. |
Wenn ein Lautsprecher oder Piezo-Schallgeber an den Portpin angeschlossen wird dan kann man mit SOUND Töne erzeugen.
Der Portpin wird pulses mal an- und ausgeschaltet
Die Schleife wir duration mal ausgeführt.
Der SOUND-Befehl ist nicht dafür gedacht, genaue Frequenzen zu erzeugen. Dafür sollte ein Timer benutzt werden.
See also
NONE
Example
'----------------------------------------------------------------------------------------- 'name : sound.bas 'copyright : (c) 1995-2005, MCS Electronics 'purpose : demo : SOUND 'micro : Mega48 'suited for demo : yes 'commercial addon needed : no '----------------------------------------------------------------------------------------- $regfile = "m48def.dat" ' specify the used micro $crystal = 4000000 ' used crystal frequency $baud = 19200 ' use baud rate $hwstack = 32 ' default use 32 for the hardware stack $swstack = 10 ' default use 10 for the SW stack $framesize = 40 ' default use 40 for the frame space Dim Pulses As Word , Periods As Word Pulses = 65535 : Periods = 10000 'set variables Speaker Alias Portb.1 'define port pin Sound Speaker , Pulses , Periods 'make some noice 'note that pulses and periods must have a high value for high XTALS 'sound is only intended to make some noise! 'pulses range from 1-65535 'periods range from 1-65535 End
Languages | English • Deutsch |
---|