CONFIG DEBOUNCE/de
From MCS Wiki AVR
< CONFIG DEBOUNCE(Difference between revisions)
(→See also) |
(→Example) |
||
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 |
---|