SOUND/de

(Difference between revisions)
Jump to: navigation, search
((**COPIED FROM ENGLISH PAGE**) =)
(Remarks)
Line 15: Line 15:
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
= <span class="f_Header">Remarks</span> =
+
= <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);" |  
Any I/O pin such as PORTB.0 etc.
+
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
+
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);" |  
The number of pulses to send. Byte, integer/word or constant.
+
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
+
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);" |  
The time the pin is pulled low and high.
+
Zeit, die der Pin pulsiert.
  
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
This is the value for a loop counter.
+
Dieses ist der Wet für einen Schleifenzähler.
  
 
|}
 
|}
Line 47: Line 47:
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
When you connect a speaker or a buzzer to a port pin (see hardware) , you can use the SOUND statement to generate some tones.
+
Wenn ein Lautsprecher oder Piezo-Schallgeber an den Portpin angeschlossen wird dan kann man mit SOUND Töne erzeugen.
  
The port pin is switched high and low for pulses times.
+
Der Portpin wird pulses mal an- und ausgeschaltet
  
This loop is executed duration times.
+
Die Schleife wir duration mal ausgeführt.
  
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
The SOUND statement is not intended to generate accurate frequencies. Use a TIMER to do that.
+
Der SOUND-Befehl ist nicht dafür gedacht, genaue Frequenzen zu erzeugen. Dafür sollte ein Timer benutzt werden.
  
 
&nbsp;
 
&nbsp;

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.

 

Sound.png

 

 

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  
Personal tools
Namespaces
Variants
Actions
Navigation
In other languages
Language