CONFIG DEBOUNCE/de

From MCS Wiki AVR
< CONFIG DEBOUNCE(Difference between revisions)
Jump to: navigation, search
(Remarks)
(Example)
 
(2 intermediate revisions by one user not shown)
Line 23: Line 23:
  
 
| valign="top" width="100%" style="width: 478px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="100%" style="width: 478px; border: 1px solid rgb(0, 0, 0);" |  
Numerische Konstante welche die Wartezeit in mS festlegt.
+
Numerische Konstante welche die Wartezeit in ms festlegt.
  
 
Die maximale Wartezeit ist 65535.
 
Die maximale Wartezeit ist 65535.
Line 37: Line 37:
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
= <span class="f_Header">See also</span> =
+
= <span class="f_Header">Siehe auch</span> =
  
 
[[DEBOUNCE]]
 
[[DEBOUNCE]]
Line 45: Line 45:
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
= <span class="f_Header">Example</span> =
+
= <span class="f_Header">Beispiel</span> =
  
 
<br/><source lang="bascomavr">
 
<br/><source lang="bascomavr">
Line 57: Line 57:
 
'-----------------------------------------------------------------------------------------
 
'-----------------------------------------------------------------------------------------
 
   
 
   
$regfile = "m48def.dat" ' specify the used micro
+
$regfile = "m48def.dat" ' Mikrocontroller
$crystal = 4000000 ' used crystal frequency
+
$crystal = 4000000 ' Taktfrequenz
$baud = 19200 ' use baud rate
+
$baud = 19200 ' Baudrate
 
$hwstack = 32 ' default use 32 for the hardware stack
 
$hwstack = 32 ' default use 32 for the hardware stack
 
$swstack = 10 ' default use 10 for the SW stack
 
$swstack = 10 ' default use 10 for the SW stack
 
$framesize = 40 ' default use 40 for the frame space
 
$framesize = 40 ' default use 40 for the frame space
 
   
 
   
Config Debounce = 30 'when the config statement is not used a default of 25mS will be used
+
Config Debounce = 30 'Wenn der CONFIG-Befehl nicht benutzt wird dann wird der Standardwert 25ms benutzt aber wir überschreiben hier den Standardwert mit 30ms.
 
   
 
   
 
   
 
   
'Debounce Pind.0 , 1 , Pr 'try this for branching when high(1)
+
'Debounce Pind.0 , 1 , Pr 'Sprung wenn High (1)
 
Debounce Pind.0 , 0 , Pr , Sub
 
Debounce Pind.0 , 0 , Pr , Sub
 
Debounce Pind.0 , 0 , Pr , Sub
 
Debounce Pind.0 , 0 , Pr , Sub
' ^----- label to branch to
+
'                     ^----- Sprungmarke
' ^---------- Branch when P1.0 goes low(0)
+
'                 ^---------- Springen wenn Pind.0 auf low (0) geht
' ^---------------- Examine P1.0
+
'         ^---------------- Pind.0 untersuchen
 
   
 
   
'When Pind.0 goes low jump to subroutine Pr
+
'Wennn Pind.0 auf low geht dann zum Unterprogramm Pr springen
'Pind.0 must go high again before it jumps again
+
'Pind.0 muss wieder auf High gehen bevor der Sprung wieder stattfindet
'to the label Pr when Pind.0 is low
+
 
   
 
   
Debounce Pind.0 , 1 , Pr 'no branch
+
Debounce Pind.0 , 1 , Pr 'Sprung nicht zu Unterprogramm
Debounce Pind.0 , 1 , Pr 'will result in a return without gosub
+
Debounce Pind.0 , 1 , Pr 'Ergibt return ohne gosub
 
End
 
End
 
   
 
   
 
Pr:
 
Pr:
Print "PIND.0 was/is low"
+
Print "PIND.0 war/ist low"
 
Return
 
Return
 
</source><br/>{{Languages}}
 
</source><br/>{{Languages}}
  
 
[[Category:BASCOM Language Reference/de]]
 
[[Category:BASCOM Language Reference/de]]

Latest revision as of 01:44, 5 March 2013

Contents

Funktion

Konfiguriert die Wartezeit für den DEBOUNCE-Befehl.

 

 

Syntax

CONFIG DEBOUNCE = time

 

 

Anmerkungen

time

Numerische Konstante welche die Wartezeit in ms festlegt.

Die maximale Wartezeit ist 65535.

 

Wenn die Wartezeit nicht konfiguriert wird dann wird der Standardwert 25 ms verwendet.

 

 

Siehe auch

DEBOUNCE

 

 

Beispiel


'-----------------------------------------------------------------------------------------
'name : deboun.bas
'copyright : (c) 1995-2005, MCS Electronics
'purpose : demonstrates DEBOUNCE
'micro : Mega48
'suited for demo : yes
'commercial addon needed : no
'-----------------------------------------------------------------------------------------
 
$regfile = "m48def.dat" ' Mikrocontroller
$crystal = 4000000 ' Taktfrequenz
$baud = 19200 ' Baudrate
$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
 
Config Debounce = 30 'Wenn der CONFIG-Befehl nicht benutzt wird dann wird der Standardwert 25ms benutzt aber wir überschreiben hier den Standardwert mit 30ms. 
 
 
'Debounce Pind.0 , 1 , Pr 'Sprung wenn High (1)
Debounce Pind.0 , 0 , Pr , Sub
Debounce Pind.0 , 0 , Pr , Sub
'                      ^----- Sprungmarke
'                  ^---------- Springen wenn Pind.0 auf low (0) geht
'          ^----------------  Pind.0 untersuchen
 
'Wennn Pind.0 auf low geht dann zum Unterprogramm Pr springen
'Pind.0 muss wieder auf High gehen bevor der Sprung wieder stattfindet
 
Debounce Pind.0 , 1 , Pr 'Sprung nicht zu Unterprogramm
Debounce Pind.0 , 1 , Pr 'Ergibt return ohne gosub
End
 
Pr:
Print "PIND.0 war/ist low"
Return

Languages   English Deutsch  
Personal tools
Namespaces
Variants
Actions
Navigation
In other languages
Language