-
Ordering information
Call us or mail us for inquiries & availability: info@mtronixtech.com
-
Search projects by Price
-
Project Categories
- Robots and Robotics
- GSM based Projects
- GPS based Projects
- RFID based Projects
- Energy Saving
- Wireless Communication
- DTMF based projects
- SMS based projects
- RF Remote
- Mobile Controlled
- Power Saver
- Sensor based Projects
- Alcohol Sensor
- heartbeat Sensor
- Humidity Sensor
- Infrared Sensor
- Level Sensor
- Light Sensor
- LPG Gas Sensor
- Moisture Sensor
- Temperature Sensor
- Vibration Sensor
- Weight Sensor
-
Search projects by Application
Project Videos:
Landrover Robot Operated by Cellphone
Industrial Automation using Cellphone
Password based door locking
Automatic room light controller
Temperature controlled fan
Electronic voting machine
Search by Components
89c51 89s51 89s52 89v51RD2 555 ADC0808 ADC0809 AT24c16 AT24c64 AT89s52 Battery BC547 Bulb Buzzer Darlington Pair DC motor Decoder EEPROM Fan GPS GSM IR LED Keypad L239D LCD Display LDR LED LM35 LM358 Matrix keypad MAX232 Motor Driver MQ6 PC Interface Relay RFID Card RFID Reader RFID Tags Sim300 sim900 SR86 SR87 Stepper Motor SYHS220 TSOP1738
LED Flashing programming in Embedded C language
Sample code for LED Flashing using delay subroutine.
Following code can be using for 8051 and 8052 ICs like: 89c51, 89c52, 89s51, 89s52, 89c2051.
;==========================================================#include <reg52.h> // special function register declarations #include <stdio.h> // prototype declarations for I/O functions #define LEDPORT P2 void Delay(void); //Function prototype declaration void main (void) { while(1) //End less while so that program never ends { LEDPORT = 0x55; //01010101 binary Delay(); LEDPORT = 0xaa; //10101010 binary Delay(); } } void Delay(void) { int i, j; for(i=0;i<10;i++) { for(j=0;j<10000;j++) { } } }
Assembly code for LED Flashing
;==========================================================;==========================================================org 0000h jmp start start: mov p1,#FFh call delay mov p1,#00h call delay jmp start delay: mov r0,#10 del2: mov r1,#250 del1: mov r2,#250 djnz r2,$ djnz r1,del1 djnz r0,del2 ret end