How to create inbuilt delay function in robotics programming?

This is 8051 code to create inbuilt “delay” function.

In Keil, there is no inbuilt function for delay. So we have to use the “for” loop to create delay, every time.

So study this program so that you will understand how to create UDF only once in your program, and just write delay(1000); or something like this wherever you want to insert delay.

Try this, its really interesting!

Even our students of Basic Robotics Course (Level-1) can try the code given in red color in the following program.

This will avoid writing _delay_ms(1000); or something like that every time in your program.

This code is equally applicable to ATMega8/16 programming. Its the inbuilt coding style of “C” or “C++”.

Remember, you have to use this code, before the main() function of your program.

If you want to change the word “delay” to create delay, in your program, simply change it in the following line of the code….

void delay(unsigned int time)
#include <reg52.h>

#define LEDs P1 // assigning the PORT1 to the 4 LEDs

void delay(unsigned int time) // user defined “delay” function
{
int a,b;
for(a=0;a<time;a++)
{
 for(b=0;b<1275;b++);
}
}

main() // main function of the program
{
while(1) // infinite loop
{
LEDs=0x0F; // all LEDs are ON, because P1^3 to P1^0=1111
delay(1000); // user defined “delay” function is used here

LEDs=0x00; // all LEDs are OFF, because P1^3 to P1^0=0000
delay(1000); // user defined “delay” function is used here

} // while closed   
} // main function closed

Everything for robotics students

This page presents everything for robotics students. The regularly needed software, files, programs, codes, hardware details, latest updates, etc.

This page is divided into two sections: For Basic Batch Students i.e. Level-2 and for Advanced Batch Students i.e. Level-3 students.

Interested to join our robotics courses? Take online admission.

 

For Level-2 Students

Software

These are the software list with download links. You can download them for free or you can also collect them from us in your pen drive. Contact us personally for the same.

Important Note: First install WIN AVR and then install AVR Studio4 software on your PC or laptop.

Files

These files may be useful to you if you come across any PC level issues. You can download or collect them from us in your pen drive.

For Level-3 Students

Software

These are the software for advanced robotics students. Click the link to download. You can also collect them from us in your pen drive. Contact us personally for the same.

Files

These files may be useful to you if you come across any PC level issues. You can download or collect them from us in your pen drive.

  • USBasp Drivers for Windows 10 – If you are having problems in your USBasp programmer and if you cannot program your 8051 dev. board, then download this drivers and install in your PC. Then reboot your PC, everything will be alright.

How to run AVR Studio 4 in Windows 8.1 or higher operating system?

The purpose of writing this post “How to run AVR Studio 4 in Windows 8.1 or higher operating system?“, is because our students were always facing this problem of running AVR Studio 4 in Windows 8.1 or higher versions of Windows. Now the problem is solved. Follow the procedure as given below: Continue reading How to run AVR Studio 4 in Windows 8.1 or higher operating system?

Pololu compatible codes for your own robotic kit ATMega8/16/32

If you have enough practice of working with ATMega16, then you can use these Pololu codes for your own robotic kit. Some hardware modifications are necessary in your ATMega8/16/32 robotic kit, but these codes given here are fully tested with these hardware. Continue reading Pololu compatible codes for your own robotic kit ATMega8/16/32

Robotics education in Akola! Robotics training in Akola!

Robotics education in Akola is now possible!

kit
Completely ready robotic kit with the details of its accessories for different connections

We provide the best education in basic and advanced robotics at Vidyasagar Academy, Akola. It has already gone viral and many students have taken advantage of our short term robotic courses (3-6 days maximum). Continue reading Robotics education in Akola! Robotics training in Akola!

Robotics Competition at Jubilee English CBSE School, Kumbhari

The Robotics Study Club run under Vidyasagar Academy, recently conducted Robotics Competition at Jubilee English CBSE School, Kumbhari. The students from 8-9th standard who already learnt our fundamental course in robotics, participated in this competition. Continue reading Robotics Competition at Jubilee English CBSE School, Kumbhari