CONFIG DEBOUNCE/de
From MCS Wiki AVR
< CONFIG DEBOUNCE(Difference between revisions)
m (1 revision) |
(→Example) |
||
(4 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
− | + | = <span class="f_Header">Funktion</span> = | |
− | + | Konfiguriert die Wartezeit für den DEBOUNCE-Befehl. | |
<span style="font-family: Arial;"> </span> | <span style="font-family: Arial;"> </span> | ||
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="568" cellspacing="0" cellpadding="1" border="1" style="border: 2px solid rgb(0, 0, 0); border-spacing: 0px; border-collapse: collapse;" | {| width="568" cellspacing="0" cellpadding="1" border="1" style="border: 2px solid rgb(0, 0, 0); border-spacing: 0px; border-collapse: collapse;" | ||
|- style="vertical-align: top;" | |- style="vertical-align: top;" | ||
| valign="top" width="15%" style="width: 81px; border: 1px solid rgb(0, 0, 0);" | | | valign="top" width="15%" style="width: 81px; border: 1px solid rgb(0, 0, 0);" | | ||
− | + | time | |
| 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. | |
− | + | Die maximale Wartezeit ist 65535. | |
|} | |} | ||
Line 31: | Line 31: | ||
<span style="font-family: Arial;"> </span> | <span style="font-family: Arial;"> </span> | ||
− | + | Wenn die Wartezeit nicht konfiguriert wird dann wird der Standardwert 25 ms verwendet. | |
<span style="font-family: Arial;"> </span> | <span style="font-family: Arial;"> </span> | ||
Line 37: | Line 37: | ||
<span style="font-family: Arial;"> </span> | <span style="font-family: Arial;"> </span> | ||
− | = <span class="f_Header"> | + | = <span class="f_Header">Siehe auch</span> = |
[[DEBOUNCE]] | [[DEBOUNCE]] | ||
Line 45: | Line 45: | ||
<span style="font-family: Arial;"> </span> | <span style="font-family: Arial;"> </span> | ||
− | = <span class="f_Header"> | + | = <span class="f_Header">Beispiel</span> = |
<br/><source lang="bascomavr"> | <br/><source lang="bascomavr"> | ||
Line 57: | Line 57: | ||
'----------------------------------------------------------------------------------------- | '----------------------------------------------------------------------------------------- | ||
− | $regfile = "m48def.dat" ' | + | $regfile = "m48def.dat" ' Mikrocontroller |
− | $crystal = 4000000 ' | + | $crystal = 4000000 ' Taktfrequenz |
− | $baud = 19200 ' | + | $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 ' | + | 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 ' | + | '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 | ||
− | ' ^----- | + | ' ^----- 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 | + | 'Pind.0 muss wieder auf High gehen bevor der Sprung wieder stattfindet |
− | + | ||
− | Debounce Pind.0 , 1 , Pr ' | + | Debounce Pind.0 , 1 , Pr 'Sprung nicht zu Unterprogramm |
− | Debounce Pind.0 , 1 , Pr ' | + | Debounce Pind.0 , 1 , Pr 'Ergibt return ohne gosub |
End | End | ||
Pr: | Pr: | ||
− | Print "PIND.0 | + | 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
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 |
---|