DELAY/de

From MCS Wiki AVR
< DELAY
Revision as of 00:45, 17 February 2013 by Stefanhamburg (Talk | contribs)
Jump to: navigation, search

Action

Verzögert den Programmablauf für kurze Zeit.

 

 

Contents

Syntax

DELAY

 

 

Remarks

Benutzen Sie DELAY um eine kurze Zeit zu warten.

Die Wartezeit ist ca. 1000 Mikrosekunden.

 

Notice.jpg
Interrupts die häufig auftreten und/oder lange Zeit benötigen verlängern die Wartezeit.

Für genaue Wartezeiten muss ein Timer benutzt werden.

 

 

See also

WAIT , WAITMS

 

 

Example


'-----------------------------------------------------------------------------------------
'name : delay.bas
'copyright : (c) 1995-2005, MCS Electronics
'purpose : demo: DELAY, WAIT, WAITMS
'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
 
Ddrb = &HFF 'port B as output
Portb = 255
Print "Starting"
Delay 'lets wait for a very short time
Print "Now wait for 3 seconds"
Portb = 0
Wait 3
Print "Ready"
Waitms 10 'wait 10 milliseconds
Portb = 255
End

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