04.03.2013 Views

Basic Micro Studio Syntax Manual

Basic Micro Studio Syntax Manual

Basic Micro Studio Syntax Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

SLEEP<br />

<strong>Syntax</strong><br />

sleep time<br />

• Time - is a variable, constant or expression that specifi es the amount of time to sleep.<br />

Supported<br />

• BA - Supported with 1 second timings<br />

• BAN - Supported with 1 second timings<br />

• BAP - Supported with 1ms timings<br />

• BAP40 - Supported with 1ms timings<br />

Commands<br />

Description<br />

The SLEEP command is similar to the NAP command. It uses the same behind the scene method<br />

to put the processor in a lower power state. SLEEP however supports timings in increments of 1.<br />

The <strong>Basic</strong>ATOM and Nano supports 1 second timings. The <strong>Basic</strong>ATOM Pro and <strong>Basic</strong>ATOM Pro 40<br />

support 1 millisecond timing increments.<br />

Notes<br />

1. <strong>Basic</strong>ATOM and Nano support 1 second timing increments.<br />

2. <strong>Basic</strong>ATOM Pro and <strong>Basic</strong>ATOM Pro 40 support 1 millisecond timings.<br />

Example<br />

The example program shown below will sleep for 1 minute on a <strong>Basic</strong>ATOM and Nano. Increase 60 to<br />

60000 to sleep for the same time on the <strong>Basic</strong>ATOM Pro and <strong>Basic</strong>ATOM Pro 40 .<br />

main<br />

serout s_out, i9600, [“Going to Sleep”]<br />

sleep 60 ;change to 6000 for ATOM Pro<br />

serout s_out, i9600, [“I’m awake!”]<br />

goto main<br />

194

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!