LED blink program

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Good afternoon all,

   

Am trying to blink an led using fx2lp breakout board. We connected one led at pin portA.0. By keeping examples program as reference given in the fx2lp dvk kit website We written the code for this one. We are getting error as shown below.

   

Please let me know how to solve this problem.

   


#include<reg51F.h>
sbit led = PA.0;

void wait(int x)
{
    int i, j;
    for(i = 0; i<x; i++)
    {
        for(j = 0; j<25; j++);
    }
}
int main()
{
    while(1)
    {
        led = 1;
        wait(100);
        led = 0;
        wait(100);
    }
    return 0;
}
   
   

   

 

   

Regards

   

Vimala
                 
 

0 Likes
3 Replies
Anonymous
Not applicable

 Hi,

   

 

   

It is clearly written in the error log.

   

 

   

-> It seems that there is no file with reg51F.h in your project that is included(warning)

   

 

   

-> PA.0 is it defined in any .h files that you have included?check whether it is "PA.0" or "PA0"

   

 

   

Inlcude the header files correctly before using the content in those headef iles

   

 

   

Regards,

   

VIkas

0 Likes
Anonymous
Not applicable

Good morning

   

Thanks for your reply.

   

We tried the code by keeping reference example program BLINKY code, which we got by installing the cypress driver.

   

C:\Cypress\USB\CY3684_EZ-USB_FX2LP_DVK\1.1\uV2_4k\C51\EXAMPLES\BLINKY

   

Please go through the code attached below.

   

Where i get reg51F.h header file as mentioned in the below attached code?

   

 

   

Regards

   

Vimala

0 Likes

You need configure port as output.

0 Likes