CONFIG DEBOUNCE/de
From MCS Wiki AVR
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 |
---|