Announcements

Help us improve the Power & Sensing Selection Guide. Share feedback

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.
urchc_1533771
Level 5
Level 5
5 likes given First like received First like given

I can`t control  output pin. I made as in example :

   

#define LED_OFF                            1u
#define LED_ON                            0u

   

RED_Write(LED_ON);

   

RED_Write(LED_OFF);

   

But it always On and not changed 😞    

   

Attached pin settings window.

   

What wrong ?

0 Likes
1 Solution
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Your main-loop is

   

    for(;;)
    {
        /* Place your application code here. */
        LED_Write(LED_ON);
        CyDelay( 500);
        LED_Write(LED_OFF);
        
    }

   

So you will need another delay after switching the LED off or it will be switched on immediately when the loop is executed again.

   

 

   

Bob

View solution in original post

0 Likes
6 Replies
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received
        Chaplin: please send your code so we can determine what the issue is.   
0 Likes
lock attach
Attachments are accessible only for community members.
urchc_1533771
Level 5
Level 5
5 likes given First like received First like given

attached

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Your main-loop is

   

    for(;;)
    {
        /* Place your application code here. */
        LED_Write(LED_ON);
        CyDelay( 500);
        LED_Write(LED_OFF);
        
    }

   

So you will need another delay after switching the LED off or it will be switched on immediately when the loop is executed again.

   

 

   

Bob

0 Likes
lock attach
Attachments are accessible only for community members.
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

Chaplin: Here is your program working as it should.

0 Likes
lock attach
Attachments are accessible only for community members.
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

Here is the Cypress app on using pins.

0 Likes
urchc_1533771
Level 5
Level 5
5 likes given First like received First like given

Thanks

0 Likes