enable Property

Top  Previous  Next

Gets or sets which pins of Port A are analog inputs.

Syntax

Cell.ADC.enable

Property Value

A bit mask identifying pins on Port A that are analog inputs.

Remarks

Each pin of Port A has a corresponding bit value, as shown in the table:

 

Port A Pin

Bit Value

A0

0x01

A1

0x02

A2

0x04

A3

0x08

A4

0x10

A5

0x20

A6

0x40

A7

0x80

 

To set a single analog input, assign its bit value to the enable property. To set multiple analog inputs, OR the bit values together and assign the result to enable.

Examples

// Make pins A0, A1, & A7 analog

Cell.ADC.enable = 0x01 | 0x02 | 0x80;

Cell.ADC.enable = 0x83;// Same

 

// Make pin A7 digital again

Cell.ADC.enable &= ~0x80;