Assembly langugecode to illuminate some LED's?

Thread Starter

msauder

Joined May 3, 2009
1
maxbotix.com EZ0 sensor

Above is a simple distance sensor I bought.
I want to turn on LED's for a distance to a wall warning device.

RED = stop!
Amber = Warning prepare to stop
Green = ok to drive

I will simulate using a Dragon 12+ plus microcontroller board and debug 12.

I need code for this in Assembler language.

Note:
Once I have it I want to consider sounds such that:
RED led = constant warning chime
Yellow = slow beep
Green = no beep
Flashing red LED = you are closer than 1.0 feet to a wall and are about to hit.

I will use the AN analog o/p of the maxbotix sensor.
The device turns out a voltage corresponding to the distance.

So, when you are at 5 feet or greater from a wall we should turn on a green LED.

If we are at 2.5 to 4.9 feet we should turn on a Yellow led.

If we are at 2.4 feet to 1.5 feet = red.

I have the idea that anything under 1.4 to 0 feet should flash a red led!!!


Does anyone have and idea how to do this or how to at least program the microcontroller so that it can illuminated the corresponding LED's?
 
Top