04.03.2013 Views

Basic Micro Studio Syntax Manual

Basic Micro Studio Syntax Manual

Basic Micro Studio Syntax Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ADIN<br />

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

adin pin, result<br />

Commands<br />

• Pin - is a variable or constant that specifi es the pin to use for the analog reading. Must be an<br />

analog capable pin.<br />

• Result - is a word (or larger) sized variable used to store the analog results.<br />

Supported<br />

• BA - Supported.<br />

• BAN - Supported.<br />

• BAP - Supported.<br />

• BAP40 - Supported.<br />

Description<br />

The ADIN command directly accesses the built-in analog hardware. The analog hardware can<br />

read any analog voltage from 0 to 5VDC. This will give 1024 positions. GND = 0 and 5V = 1023.<br />

Depending on the module type you are using the speed at which analog samples are performed<br />

varies. Each processor’s analog pins differ. See the table below:<br />

Analog Capable Pins<br />

Processor Pins<br />

Nano 18 P6 to P11<br />

Nano 28 P0 to P5 and P16 to P20<br />

Nano 40 P0 to P5 and P24 to P31<br />

Atom 24m AX0, AX1, AX3<br />

Atom 28m P0 to P5 and P16 to P19<br />

Atom 40m P0 to P5 and P24 to P31<br />

AtomPro One P0 to P3<br />

AtomPro 24m P0 to P3<br />

AtomPro 28m P0 to P3 and P16 to P19<br />

AtomPro 40m P0 to P3 and P28 to P31<br />

Notes<br />

1. The ADIN conversion must complete before the program will process the next command. The AD<br />

conversion typically takes around 8 micro seconds.<br />

2. The ADIN command only works with pins that are analog capable.<br />

3. The analog pins for each module or Nano are listed in it’s corresponding data sheet and differ from<br />

module to module.<br />

85

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

Saved successfully!

Ooh no, something went wrong!