cancel
Showing results for 
Search instead for 
Did you mean: 

donno how to handle range.

alanlai1
Associate II
Posted on November 03, 2003 at 06:39

donno how to handle range.

1 REPLY 1
alanlai1
Associate II
Posted on November 03, 2003 at 06:39

dear all,

I am making a ADC project,

check analog data ( level 0- 255 ),

level 000-063 ->> LED1 off LED2 off

level 064-127 ->> LED1 off LED2 on

level 128-255 ->> LED1 on LED2 off

I have reference the example from indart, but I dont know how to handle the range determination is better.

Please recommend some simple method,

Is it the following okay ? please advice, thank you very much

eg)

.CHECK_3_LEVEL

LD A , ADCDR

LD VALREAD , A

LD A , #$20

SUB A , VALREAD

JGURE RANGE_000_063

LD A , #$40

SUB A , VALREAD

JGURE RANGE_064_127

LD A , #$80

SUB A , VALREAD

JGURE RANGE_128_255

JP CHECK_3_LEVEL